1# RUN: ld64.lld.darwinold -arch x86_64  %s -dylib -o %t %p/Inputs/x86_64/libSystem.yaml
2# RUN: llvm-nm -m -n %t | FileCheck %s
3#
4# Test that __mh_dylib_header symbol is available for dylibs
5#
6
7--- !mach-o
8arch:            x86_64
9file-type:       MH_OBJECT
10flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
11sections:
12  - segment:         __TEXT
13    section:         __text
14    type:            S_REGULAR
15    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
16    address:         0x0000000000000000
17    content:         [ 0x55, 0x48, 0x89, 0xE5, 0x31, 0xC0, 0x5D, 0xC3 ]
18  - segment:         __DATA
19    section:         __data
20    type:            S_REGULAR
21    attributes:      [  ]
22    alignment:       8
23    address:         0x0000000000000008
24    content:         [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
25    relocations:
26      - offset:          0x00000000
27        type:            X86_64_RELOC_UNSIGNED
28        length:          3
29        pc-rel:          false
30        extern:          true
31        symbol:          2
32global-symbols:
33  - name:            _d
34    type:            N_SECT
35    scope:           [ N_EXT ]
36    sect:            2
37    value:           0x0000000000000008
38  - name:            _foo
39    type:            N_SECT
40    scope:           [ N_EXT ]
41    sect:            1
42    value:           0x0000000000000000
43undefined-symbols:
44  - name:            __mh_dylib_header
45    type:            N_UNDF
46    scope:           [ N_EXT ]
47    value:           0x0000000000000000
48
49
50...
51
52# CHECK_NOT:	__mh_dylib_header
53# CHECK:      _foo
54