[PATCH] D57673: [PPC64] Set the number of relocations processed for R_PPC64_TLS[GL]D to 2

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 18:27:27 PST 2019


MaskRay marked an inline comment as done and an inline comment as not done.
MaskRay added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:246
+int PPC64::getTlsGdRelaxSkip(RelType Type) const {
+  // Skip the next relocation R_PPC64_REL24 __tls_get_addr.
+  if (Type == R_PPC64_TLSGD || Type == R_PPC64_TLSLD)
----------------
sfertile wrote:
> I think we should describe it a bit more in depth as its not clear why we skip 2 unless you are familiar with PPC64 tls already. maybe along the lines of:
> 
> ```The calls to __tls_get_addr are marked with 2 relocations on the call instructions. The first is a TLS hint to tie the call to its tls related arguments,  the second relocation is the R_PPC64_REL24 used to speicfy the target of the call. When we relax the tls sequnce we no longer need the call and should skip both relocations to not create a false dependence on __tls_get_addr being defined.```
Added a comment with your suggestion in mind. Does it look good?


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D57673





More information about the llvm-commits mailing list