[PATCH] D31751: [LLD][ELF] Tidy up handleARMTlsRelocation [NFC]

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 14:47:43 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/Target.cpp:1842
   case R_ARM_TLS_TPOFF32:
+  case R_ARM_TLS_DTPOFF32:
     write32le(Loc, Val);
----------------
peter.smith wrote:
> ruiu wrote:
> > Why do you need this?
> It is so the same relocation code can be used in: 
> 
> ```
> AddTlsReloc(Off + Config->Wordsize, Target->TlsOffsetRel, &Body, NeedDynOff);
> ```
> Without it, it would need to be
> 
> ```
> AddTlsReloc(Off + Config->Wordsize, NeedDynOff ? Target->TlsOffsetRel : R_ARM_ABS32, NeedDynOff);
> ```
> As when we statically come to resolve the R_ARM_TLS_DTPOFF32 we get unknown relocation code.
> 
> I thought that the trade off in adding R_ARM_TLS_DTPOFF32 was worth it as it emphasized that the dynamic relocation was just being evaluated at static link time. I'm not hugely fussed about doing it this way.
Got it. Thank you for explaining. I think I'm slightly inclined to go with R_ARM_ABS32, but because we already have TLS relocations here, I"m OK with the new code.


https://reviews.llvm.org/D31751





More information about the llvm-commits mailing list