]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Pull in r353299 from upstream lld trunk (by George Rimar):
authordim <dim@FreeBSD.org>
Thu, 21 Feb 2019 18:41:41 +0000 (18:41 +0000)
committerdim <dim@FreeBSD.org>
Thu, 21 Feb 2019 18:41:41 +0000 (18:41 +0000)
commit992b29a96b7e0ec0c8fae9137149789d42932b21
tree35d21e235e1abe7dce206da28e161b6c43abf6c5
parent32731864c4f89939282a0e0ef6e938e56da069f3
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
MFC after: 1 week
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