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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 17:43:15 PST 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:

Not specific to this PR. We could remove R_X86_64_NONE. Here R_X86_64_NONE is not the best example to follow. You should follow other architectures without NONE.

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


More information about the llvm-commits mailing list