An upcoming commit will change how we choose to reference a dylib. Currently dylibs are only given an LC_LOAD_DYLIB in the final image if an atom is used. This is different from ld64 which adds the load command when the dylib is referenced on the cmdline. In order to change this behaviour, we need libSystem.yaml to actually contain a mach header so that it is parsed as a dylib, instead of currently being parsed as a normalised file. To get a mach header, we also require an arch, so now we have one libsystem per arch and all the tests have been updated to choose the correct one. llvm-svn: 278372
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 \
|
|
# RUN: %s %p/Inputs/x86_64/libSystem.yaml -o %t && \
|
|
# RUN: llvm-objdump -exports-trie %t | FileCheck %s
|
|
#
|
|
#
|
|
# Tests that exports trie builds properly.
|
|
#
|
|
|
|
--- !mach-o
|
|
arch: x86_64
|
|
file-type: MH_OBJECT
|
|
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
|
|
sections:
|
|
- segment: __TEXT
|
|
section: __text
|
|
type: S_REGULAR
|
|
attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
|
|
address: 0x0000000000000000
|
|
content: [ 0xC3, 0xC3, 0xC3, 0xC3 ]
|
|
global-symbols:
|
|
- name: _myHidden
|
|
type: N_SECT
|
|
scope: [ N_EXT, N_PEXT ]
|
|
sect: 1
|
|
value: 0x0000000000000000
|
|
- name: _myRegular
|
|
type: N_SECT
|
|
scope: [ N_EXT ]
|
|
sect: 1
|
|
value: 0x0000000000000001
|
|
- name: _myWeak
|
|
type: N_SECT
|
|
scope: [ N_EXT ]
|
|
sect: 1
|
|
desc: [ N_WEAK_DEF ]
|
|
value: 0x0000000000000002
|
|
- name: _main
|
|
type: N_SECT
|
|
scope: [ N_EXT ]
|
|
sect: 1
|
|
value: 0x0000000000000003
|
|
...
|
|
|
|
# CHECK-NOT: _myHidden
|
|
# CHECK: 0x00000FFD _myRegular
|
|
# CHECK: 0x00000FFE _myWeak [weak_def]
|