-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to lld to use Text Based API stubs for linking. This is support is incomplete not filtering out platforms. It also does not account for architecture specific API handling and potentially does not correctly handle trees of re-exports with inlined libraries being treated as direct children of the top level library.
- Loading branch information
Showing
8 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- !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/libdyld.dylib' | ||
current-version: 0001.001.1 | ||
parent-umbrella: System | ||
exports: | ||
- archs: [ 'x86_64' ] | ||
symbols: [ dyld_stub_binder ] | ||
--- !tapi-tbd-v3 | ||
archs: [ x86_64 ] | ||
uuids: [ 'x86_64: 00000000-0000-0000-0000-000000000002' ] | ||
platform: macosx | ||
install-name: '/usr/lib/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/libsystem_m.dylib' | ||
current-version: 0001.001.1 | ||
parent-umbrella: System | ||
exports: | ||
- archs: [ 'x86_64' ] | ||
symbols: [ ___nan ] | ||
... |
23 changes: 23 additions & 0 deletions
23
lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- !tapi-tbd-v3 | ||
archs: [ i386, x86_64 ] | ||
uuids: [ 'i386: 00000000-0000-0000-0000-000000000000', 'x86_64: 00000000-0000-0000-0000-000000000001' ] | ||
platform: ios | ||
install-name: '/usr/lib/libSystem.B.dylib' | ||
current-version: 1281 | ||
exports: | ||
- archs: [ i386, x86_64 ] | ||
re-exports: [ '/usr/lib/system/libcache.dylib' ] | ||
symbols: [ __crashreporter_info__ ] | ||
--- !tapi-tbd-v3 | ||
archs: [ i386, x86_64 ] | ||
uuids: [ 'i386: 00000000-0000-0000-0000-000000000002', 'x86_64: 00000000-0000-0000-0000-000000000003' ] | ||
platform: ios | ||
install-name: '/usr/lib/libcache.dylib' | ||
current-version: 83 | ||
parent-umbrella: System | ||
exports: | ||
- archs: [ i386 ] | ||
symbols: [ __cache_handle_memory_pressure_event ] | ||
- archs: [ i386, x86_64 ] | ||
symbols: [ _cache_create, _cache_destroy, _cache_get ] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# REQUIRES: x86 | ||
|
||
# RUN: mkdir -p %t | ||
# | ||
# RUN: llvm-mc -filetype obj -triple x86_64-apple-ios %s -o %t/test.o | ||
# RUN: not lld -flavor darwinnew -o %t/test -Z -L%S/../Inputs/iPhoneSimulator.sdk/usr/lib -lSystem %t/test.o 2>&1 | FileCheck %s | ||
|
||
# CHECK: error: undefined symbol __cache_handle_memory_pressure_event | ||
|
||
.section __TEXT,__text | ||
.global _main | ||
|
||
_main: | ||
movq __cache_handle_memory_pressure_event@GOTPCREL(%rip), %rax | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# REQUIRES: x86 | ||
|
||
# RUN: mkdir -p %t | ||
# | ||
# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o | ||
# RUN: lld -flavor darwinnew -o %t/test -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem %t/test.o | ||
# | ||
# RUN: llvm-objdump --bind --no-show-raw-insn -d -r %t/test | FileCheck %s | ||
|
||
# CHECK: Disassembly of section __TEXT,__text: | ||
# CHECK: movq {{.*}} # [[ADDR:[0-9a-f]+]] | ||
|
||
# CHECK: Bind table: | ||
# CHECK: __DATA_CONST __got 0x[[ADDR]] pointer 0 libSystem ___nan | ||
|
||
.section __TEXT,__text | ||
.global _main | ||
|
||
_main: | ||
movq ___nan@GOTPCREL(%rip), %rax | ||
ret |