[PATCH] D13615: [lld][elf2] Local Dynamic TLS

Michael Spencer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 13:11:28 PST 2019


Bigcheese abandoned this revision.
Bigcheese marked 5 inline comments as done.
Bigcheese added inline comments.
Herald added subscribers: dexonsmith, MaskRay.


================
Comment at: ELF/OutputSections.cpp:128
 
-    bool CanBePreempted = canBePreempted(Body);
+    bool CanBePreempted = canBePreempted(Body) || Type == R_X86_64_TLSLD;
     uintX_t Addend = 0;
----------------
ruiu wrote:
> I don't understand this. Is R_x86_64_TLSLD interpositioned? This function is really complicated and needs cleanup.
R_X86_64_TLSLD can't be preempted, but this is the function that's used to determine if we should emit a dynamic relocation for it or not. As I said in the description, I wanted some guidance on how to restructure the GOT code to handle this.


================
Comment at: ELF/Writer.cpp:143
   Out<ELFT>::Dynamic = &Dynamic;
+  Out<ELFT>::ThreadDataStart = 0;
 
----------------
ruiu wrote:
> Global uninitialized values should be initialized with zero, so no need to assign the same value again.
This would make writeResult non-reentrant while it currently is reentrant.


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

https://reviews.llvm.org/D13615





More information about the llvm-commits mailing list