xref: /llvm-project/lld/test/MachO/obj-file-with-stabs.s (revision e183bf8e1599d98bade8fe4a5774c23b9a67655b)
1# REQUIRES: x86
2## FIXME: This yaml is from an object file produced with 'ld -r':
3##
4##   echo "int main() {return 1;}" > test.c
5##   clang -c -g -o test.o test.c
6##   ld -r -o test2.o test.o -no_data_in_code_info
7##
8## Replace this with "normal" .s test format once lld supports `-r`
9
10# RUN: yaml2obj %s -o %t.o
11# RUN: %lld -lSystem -arch x86_64 %t.o -o %t
12
13--- !mach-o
14FileHeader:
15  magic:           0xFEEDFACF
16  cputype:         0x1000007
17  cpusubtype:      0x3
18  filetype:        0x1
19  ncmds:           3
20  sizeofcmds:      288
21  flags:           0x2000
22  reserved:        0x0
23LoadCommands:
24  - cmd:             LC_SEGMENT_64
25    cmdsize:         232
26    segname:         ''
27    vmaddr:          0
28    vmsize:          56
29    fileoff:         352
30    filesize:        56
31    maxprot:         7
32    initprot:        7
33    nsects:          2
34    flags:           0
35    Sections:
36      - sectname:        __text
37        segname:         __TEXT
38        addr:            0x0
39        size:            18
40        offset:          0x160
41        align:           4
42        reloff:          0x0
43        nreloc:          0
44        flags:           0x80000400
45        reserved1:       0x0
46        reserved2:       0x0
47        reserved3:       0x0
48        content:         554889E5C745FC00000000B8010000005DC3
49      - sectname:        __compact_unwind
50        segname:         __LD
51        addr:            0x18
52        size:            32
53        offset:          0x178
54        align:           3
55        reloff:          0x198
56        nreloc:          1
57        flags:           0x2000000
58        reserved1:       0x0
59        reserved2:       0x0
60        reserved3:       0x0
61        content:         '0000000000000000120000000000000100000000000000000000000000000000'
62        relocations:
63          - address:         0x0
64            symbolnum:       8
65            pcrel:           false
66            length:          3
67            extern:          true
68            type:            0
69            scattered:       false
70            value:           0
71  - cmd:             LC_SYMTAB
72    cmdsize:         24
73    symoff:          416
74    nsyms:           9
75    stroff:          560
76    strsize:         48
77  - cmd:             LC_BUILD_VERSION
78    cmdsize:         32
79    platform:        1
80    minos:           659200
81    sdk:             0
82    ntools:          1
83    Tools:
84      - tool:            3
85        version:         46596096
86LinkEditData:
87  NameList:
88    - n_strx:          8
89      n_type:          0x64 ## N_SO STAB
90      n_sect:          0
91      n_desc:          0
92      n_value:         0
93    - n_strx:          14
94      n_type:          0x64 ## N_SO STAB
95      n_sect:          0
96      n_desc:          0
97      n_value:         0
98    - n_strx:          21
99      n_type:          0x66 ## N_OSO STAB
100      n_sect:          3
101      n_desc:          1
102      n_value:         1651001352
103    - n_strx:          1
104      n_type:          0x2E ## N_BNSYM STAB
105      n_sect:          1
106      n_desc:          0
107      n_value:         0
108    - n_strx:          41
109      n_type:          0x24 ## N_FUN STAB
110      n_sect:          1
111      n_desc:          0
112      n_value:         0
113    - n_strx:          1
114      n_type:          0x24 ## N_FUN STAB
115      n_sect:          0
116      n_desc:          0
117      n_value:         18
118    - n_strx:          1
119      n_type:          0x4E ## N_ENSYM STAB
120      n_sect:          1
121      n_desc:          0
122      n_value:         18
123    - n_strx:          1
124      n_type:          0x64 ## N_SO STAB
125      n_sect:          1
126      n_desc:          0
127      n_value:         0
128    - n_strx:          2
129      n_type:          0xF
130      n_sect:          1
131      n_desc:          0
132      n_value:         0
133  StringTable:
134    - ' '
135    - _main
136    - '/tmp/'
137    - test.c
138    - '/private/tmp/test.o'
139    - _main
140    - ''
141...
142