[llvm] [RelocationResolver][Xtensa] Implement R_XTENSA_32 (PR #96311)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 23:41:05 PDT 2024


================
@@ -310,6 +310,28 @@ static uint64_t resolveX86(uint64_t Type, uint64_t Offset, uint64_t S,
   }
 }
 
+static bool supportsXtensa(uint64_t Type) {
+  switch (Type) {
+  case ELF::R_XTENSA_NONE:
+  case ELF::R_XTENSA_32:
+    return true;
+  default:
+    return false;
+  }
+}
+
+static uint64_t resolveXtensa(uint64_t Type, uint64_t Offset, uint64_t S,
+                              uint64_t LocData, int64_t Addend) {
+  switch (Type) {
+  case ELF::R_XTENSA_NONE:
----------------
MaskRay wrote:

No, the comment is specific to this PR.

RelocationResolver is to handle static relocations. While R_*_NONE might be defined by a psABI, in practice it's always a toolchain bug when RelocationResolver has to resolve R_*_NONE.  We should not handle unnecessary relocations.

https://github.com/llvm/llvm-project/pull/96311


More information about the llvm-commits mailing list