2016-08-12 02:08:59 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 %s %p/Inputs/x86_64/libSystem.yaml \
|
2014-11-07 03:33:57 +08:00
|
|
|
# RUN: %p/Inputs/libfoo.a %p/Inputs/libbar.a -o %t1
|
|
|
|
# RUN: llvm-nm -m -n %t1 | FileCheck %s
|
|
|
|
#
|
2016-08-12 02:08:59 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 %s %p/Inputs/x86_64/libSystem.yaml \
|
2014-11-07 03:33:57 +08:00
|
|
|
# RUN: -force_load %p/Inputs/libfoo.a %p/Inputs/libbar.a -o %t2
|
|
|
|
# RUN: llvm-nm -m -n %t2 | FileCheck --check-prefix=CHECKF %s
|
|
|
|
#
|
|
|
|
# Test that -force_load causes members of static library to be loaded.
|
|
|
|
#
|
|
|
|
|
|
|
|
--- !mach-o
|
|
|
|
arch: x86_64
|
|
|
|
file-type: MH_OBJECT
|
|
|
|
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
|
|
|
|
has-UUID: false
|
|
|
|
OS: unknown
|
2015-04-28 01:18:04 +08:00
|
|
|
sections:
|
2014-11-07 03:33:57 +08:00
|
|
|
- segment: __TEXT
|
|
|
|
section: __text
|
|
|
|
type: S_REGULAR
|
|
|
|
attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
|
|
|
|
address: 0x0000000000000000
|
|
|
|
content: [ 0xC3 ]
|
2015-04-28 01:18:04 +08:00
|
|
|
global-symbols:
|
2014-11-07 03:33:57 +08:00
|
|
|
- name: _main
|
|
|
|
type: N_SECT
|
|
|
|
scope: [ N_EXT ]
|
|
|
|
sect: 1
|
|
|
|
value: 0x0000000000000000
|
|
|
|
...
|
|
|
|
|
|
|
|
# CHECK: {{[0-9a-f]+}} (__TEXT,__text) external _main
|
|
|
|
# CHECK-NOT: {{[0-9a-f]+}} (__TEXT,__text) external _main
|
|
|
|
|
|
|
|
# CHECKF: {{[0-9a-f]+}} (__TEXT,__text) external _main
|
|
|
|
# CHECKF: {{[0-9a-f]+}} (__TEXT,__text) external _foo
|
|
|
|
# CHECKF-NOT: {{[0-9a-f]+}} (__TEXT,__text) external _bar
|