[PATCH] D102908: [lld][ELF][SPARC] Support TLS IE relocations

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 23 07:37:59 PDT 2021


jrtc27 added inline comments.


================
Comment at: lld/ELF/Driver.cpp:929
   return m == EM_AARCH64 || m == EM_AMDGPU || m == EM_HEXAGON || m == EM_PPC ||
-         m == EM_PPC64 || m == EM_RISCV || m == EM_X86_64;
+         m == EM_PPC64 || m == EM_RISCV || m == EM_SPARCV9 || m == EM_X86_64;
 }
----------------
LemonBoy wrote:
> jrtc27 wrote:
> > LemonBoy wrote:
> > > jrtc27 wrote:
> > > > This should probably be its own commit, it's unrelated to TLS.
> > > This _is_ related to TLS as, without this change, the `R_SPARC_TLS_TPOFF64` would end up in REL form and the resulting program be rejected by `ld.so`.
> > Why is `R_SPARC_TLS_TPOFF64` special? Surely that's true of any dynamic relocation.
> It's not special, it's only the first dynamic relocation that's covered by a test (for the SPARC target, that is). Splitting this patch into many interdependent pieces is going to be a pain, especially since I already have other patches rebased on top of this.
So this is a bug fix for the fact that LLD already emits ABI-violating binaries (e.g. just have `static int x; static int *p = &x;` and link that as a shared object, then you'll get an `R_SPARC_RELATIVE` as rel rather than rela). Hence why this should be decoupled. It's a trivial one-line patch to commit.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102908/new/

https://reviews.llvm.org/D102908



More information about the llvm-commits mailing list