]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r344444:
authordim <dim@FreeBSD.org>
Thu, 28 Feb 2019 06:53:18 +0000 (06:53 +0000)
committerdim <dim@FreeBSD.org>
Thu, 28 Feb 2019 06:53:18 +0000 (06:53 +0000)
commit471beb5bb603641aeddffcd4b804fa62e0d0892c
tree87432f9b41946b8a6610c5d78bb32321cca5e290
parent61b339d12c602e70d7a09aef887fff11138af662
MFC r344444:

Pull in r353299 from upstream lld trunk (by George Rimar):

  Recommit r353293 "[LLD][ELF] - Set DF_STATIC_TLS flag for i386 target."

  With the following changes:
  1) Compilation fix:
  std::atomic<bool> HasStaticTlsModel = false; ->
  std::atomic<bool> HasStaticTlsModel{false};

  2) Adjusted the comment in code.

  Initial commit message:

  DF_STATIC_TLS flag indicates that the shared object or executable
  contains code using a static thread-local storage scheme.

  Patch checks if IE/LE relocations were used to check if the code uses
  a static model. If so it sets the DF_STATIC_TLS flag.

  Differential revision: https://reviews.llvm.org/D57749

Pull in r353378 from upstream lld trunk (by George Rimar):

  [LLD][ELF] - Set DF_STATIC_TLS flag for X64 target

  This is the same as D57749, but for x64 target.

  "ELF Handling For Thread-Local Storage" p41 says
  (https://www.akkadia.org/drepper/tls.pdf):
  R_X86_64_GOTTPOFF relocation is used for IE TLS models.
  Hence if linker sees this relocation we should add DF_STATIC_TLS flag.

  Differential revision: https://reviews.llvm.org/D57821

This adds support to lld for the DF_STATIC_TLS flag in shared objects,
which signals to the dynamic linker that the shared object requires
static thread local storage.

See also: https://reviews.freebsd.org/D19072
contrib/llvm/tools/lld/ELF/Arch/X86.cpp
contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp
contrib/llvm/tools/lld/ELF/Config.h
contrib/llvm/tools/lld/ELF/SyntheticSections.cpp