[PATCH] D102862: [lld][ELF][SPARC] Support TLS GD relocations

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 13:52:10 PDT 2021


jrtc27 added inline comments.


================
Comment at: lld/ELF/Arch/SPARCV9.cpp:212-217
+  case R_SPARC_TLS_GD_HI22:
+    relocateNoSym(loc, R_SPARC_HI22, val);
+    return;
+  case R_SPARC_TLS_GD_LO10:
+    relocateNoSym(loc, R_SPARC_LO10, val);
+    return;
----------------
LemonBoy wrote:
> jrtc27 wrote:
> > R_SPARC_TLS_IE_HI22/LO10? This is wrong, but I guess this is a hack that kinda works because IE isn't actually implemented yet? Which probably should happen before landing GD support... LD is less clear, but also seemingly unimplemented, only basic LE.
> I wouldn't call this a hack, as long as the relocation type matches it's fine to use `R_SPARC_HI22` or `R_SPARC_LO10` here.
> I have a patch for LD, I'll send it once this is merged. I don't need IE at the moment but I'll eventually look into it.
It's a bit of an abuse. I don't think it should be committed in this form. You should at least add the IE cases needed to support GD->IE so you can use the right relocations here even if you're not adding full IE support, though full IE support should be pretty straightforward to add too other than the tedium of test writing.


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

https://reviews.llvm.org/D102862



More information about the llvm-commits mailing list