[PATCH] D31749: [LLD][ELF] Fix ARM TLS global dynamic TlsOffsetRel for non-preemtible symbols

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 03:29:27 PDT 2017


peter.smith created this revision.
Herald added subscribers: rengolin, aemerson.

When the target of the TlsOffsetRel is non-preemptible we can write the offset directly into the GOT without needing a dynamic relocation. This is optional for dynamically linked executables but is required for static linking.

      

We used to rely on the GOTSection::writeTo member function to get the TLS offset of the symbol when writing the VA of the symbol. However in r288107 the GOTSection::writeTo was changed to only use relocations for writing values. Unfortunately we were missing the GOT relocation so all TLS offsets were being written as 0. This change adds the relocation to the GOT entry and a test case for non-0 offsets.

This was split out of https://reviews.llvm.org/D31672, it is based off the refactoring change in https://reviews.llvm.org/D31748.


https://reviews.llvm.org/D31749

Files:
  ELF/Relocations.cpp
  ELF/Target.cpp
  test/ELF/arm-tls-gd-nonpreemptible.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31749.94341.patch
Type: text/x-patch
Size: 2910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/0a6c79c8/attachment.bin>


More information about the llvm-commits mailing list