1# RUN: ld64.lld.darwinold -arch x86_64 -dylib %p/Inputs/bar.yaml \
2# RUN:     -install_name /usr/lib/libbar.dylib %p/Inputs/x86_64/libSystem.yaml -o %t1.dylib
3# RUN: ld64.lld.darwinold -arch x86_64 -dylib %s -all_load %t1.dylib \
4# RUN:      -install_name /usr/lib/libfoo.dylib %p/Inputs/x86_64/libSystem.yaml -o %t
5# RUN: llvm-nm -m %t | FileCheck %s
6#
7#
8# Test -all_load does not break linking with dylibs
9#
10
11--- !mach-o
12arch:            x86_64
13file-type:       MH_OBJECT
14flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
15sections:
16  - segment:         __TEXT
17    section:         __text
18    type:            S_REGULAR
19    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
20    address:         0x0000000000000000
21    content:         [ 0x55, 0x48, 0x89, 0xE5, 0x31, 0xC0, 0x5D, 0xE9,
22                       0x00, 0x00, 0x00, 0x00 ]
23    relocations:
24      - offset:          0x00000008
25        type:            X86_64_RELOC_BRANCH
26        length:          2
27        pc-rel:          true
28        extern:          true
29        symbol:          1
30global-symbols:
31  - name:            _foo
32    type:            N_SECT
33    scope:           [ N_EXT ]
34    sect:            1
35    value:           0x0000000000000000
36undefined-symbols:
37  - name:            _bar
38    type:            N_UNDF
39    scope:           [ N_EXT ]
40    value:           0x0000000000000000
41
42...
43
44
45# CHECK: (__TEXT,__text) external _foo
46