[llvm] [RelocationResolver][Xtensa] Implement R_XTENSA_32 (PR #96311)
YAMAMOTO Takashi via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 23:49:10 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:
----------------
yamt wrote:
> Yes, 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.
do you mean that for some reasons your rationale is specific to xtensa (this PR)
and doesn't apply to other non-xtensa relocations like R_X86_64_NONE?
https://github.com/llvm/llvm-project/pull/96311
More information about the llvm-commits
mailing list