HomePhabricator

[ELF] Implement Local Dynamic style TLSDESC for x86-64

Authored by MaskRay on May 30 2019, 3:00 AM.

Description

[ELF] Implement Local Dynamic style TLSDESC for x86-64

For the Local Dynamic case of TLSDESC, _TLS_MODULE_BASE_ is defined as a
special TLS symbol that makes:

  1. Without relaxation: it produces a dynamic TLSDESC relocation that

computes 0. Adding @dtpoff to access a TLS symbol.

  1. With LD->LE relaxation: _TLS_MODULE_BASE_@tpoff = 0 (lowest address in

the TLS block). Adding @tpoff to access a TLS symbol.

For 1), this saves dynamic relocations and GOT slots as otherwise
(General Dynamic) we would create an R_X86_64_TLSDESC and reserve two
GOT slots for each symbol.

Add ElfSym::TlsModuleBase and change the signature of getTlsTpOffset()
to special case _TLS_MODULE_BASE_.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D62577

llvm-svn: 362078

Details

Committed
MaskRayMay 30 2019, 3:00 AM
Reviewer
ruiu
Differential Revision
D62577: [ELF] Implement Local Dynamic style TLSDESC for x86-64
Parents
rG3475a46ec23d: Fix sphinx warning about missing footnote.
Branches
Unknown
Tags
Unknown