diff options
author | Jez Ng <jezng@fb.com> | 2020-08-07 11:04:52 -0700 |
---|---|---|
committer | Jez Ng <jezng@fb.com> | 2020-08-07 11:04:52 -0700 |
commit | ca85e3733816ce444b86dd4598c1a98a54464b10 (patch) | |
tree | 432bb6628193889e3fbb31c2ad45c0a164c4c60e /clang/lib/Tooling/Syntax/BuildTree.cpp | |
parent | 4e43f1804817b36fee62aeb7e1eb1602245efdb6 (diff) | |
download | llvm-ca85e3733816ce444b86dd4598c1a98a54464b10.zip llvm-ca85e3733816ce444b86dd4598c1a98a54464b10.tar.gz llvm-ca85e3733816ce444b86dd4598c1a98a54464b10.tar.bz2 |
[lld-macho] Support static linking of thread-locals
Note: What ELF refers to as "TLS", Mach-O seems to refer to as "TLV", i.e.
thread-local variables.
This diff implements support for TLV relocations that reference defined
symbols. On x86_64, TLV relocations are always used with movq opcodes, so for
defined TLVs, we don't need to create a synthetic section to store the
addresses of the symbols -- we can just convert the `movq` to a `leaq`.
One notable quirk of Mach-O's TLVs is that absolute-address relocations
inside TLV-defining sections behave differently -- their addresses are
no longer absolute, but relative to the start of the target section.
(AFAICT, RIP-relative relocations are not allowed in these sections.)
Reviewed By: #lld-macho, compnerd, smeenai
Differential Revision: https://reviews.llvm.org/D85080
Diffstat (limited to 'clang/lib/Tooling/Syntax/BuildTree.cpp')
0 files changed, 0 insertions, 0 deletions