Files
clang-p2996/lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
Jez Ng ca85e37338 [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
2020-08-07 11:04:52 -07:00

43 lines
1.4 KiB
Plaintext

--- !tapi-tbd-v3
archs: [ x86_64 ]
uuids: [ 'x86_64: 00000000-0000-0000-0000-000000000000' ]
platform: macosx
install-name: '/usr/lib/libSystem.B.dylib'
current-version: 0001.001.1
exports:
- archs: [ 'x86_64' ]
re-exports: [ '/usr/lib/system/libdyld.dylib',
'/usr/lib/system/libsystem_c.dylib',
'/usr/lib/system/libsystem_m.dylib' ]
--- !tapi-tbd-v3
archs: [ x86_64 ]
uuids: [ 'x86_64: 00000000-0000-0000-0000-000000000001' ]
platform: macosx
install-name: '/usr/lib/system/libdyld.dylib'
current-version: 0001.001.1
parent-umbrella: System
exports:
- archs: [ 'x86_64' ]
symbols: [ dyld_stub_binder, __tlv_bootstrap ]
--- !tapi-tbd-v3
archs: [ x86_64 ]
uuids: [ 'x86_64: 00000000-0000-0000-0000-000000000002' ]
platform: macosx
install-name: '/usr/lib/system/libsystem_c.dylib'
current-version: 0001.001.1
parent-umbrella: System
exports:
- archs: [ 'x86_64' ]
symbols: [ ]
--- !tapi-tbd-v3
archs: [ x86_64 ]
uuids: [ 'x86_64: 00000000-0000-0000-0000-000000000003' ]
platform: macosx
install-name: '/usr/lib/system/libsystem_m.dylib'
current-version: 0001.001.1
parent-umbrella: System
exports:
- archs: [ 'x86_64' ]
symbols: [ ___nan ]
...