• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: ld64.lld -arch x86_64 -o %t %s -dylib %p/Inputs/x86_64/libSystem.yaml && \
2# RUN:   llvm-nm -no-sort -debug-syms %t | FileCheck %s
3
4# CHECK:      0000000000000000 - 00 0000    SO /Users/lhames/Projects/lld/lld-svn-tot/scratch/
5# CHECK-NEXT: 0000000000000000 - 00 0000    SO hw.c
6# CHECK-NEXT:    {{[0-9a-f]+}} - 03 0001   OSO {{.*}}{{/|\\}}test{{/|\\}}mach-o{{/|\\}}debug-syms.yaml
7# CHECK-NEXT: 0000000000000fa0 - 01 0000 BNSYM
8# CHECK-NEXT: 0000000000000fa0 - 01 0000   FUN _main
9# CHECK-NEXT: 0000000000000016 - 00 0000   FUN
10# CHECK-NEXT: 0000000000000016 - 01 0000 ENSYM
11# CHECK-NEXT: 0000000000000000 - 01 0000    SO
12
13--- !mach-o
14arch:            x86_64
15file-type:       MH_OBJECT
16flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
17compat-version:  0.0
18current-version: 0.0
19has-UUID:        false
20OS:              unknown
21min-os-version-kind: LC_VERSION_MIN_MACOSX
22sections:
23  - segment:         __TEXT
24    section:         __text
25    type:            S_REGULAR
26    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
27    alignment:       16
28    address:         0x0000000000000000
29    content:         [ 0x55, 0x48, 0x89, 0xE5, 0x31, 0xC0, 0xC7, 0x45,
30                       0xFC, 0x00, 0x00, 0x00, 0x00, 0x89, 0x7D, 0xF8,
31                       0x48, 0x89, 0x75, 0xF0, 0x5D, 0xC3 ]
32  - segment:         __DWARF
33    section:         __debug_str
34    type:            S_REGULAR
35    attributes:      [ S_ATTR_DEBUG ]
36    address:         0x0000000000000016
37    content:         [ 0x41, 0x70, 0x70, 0x6C, 0x65, 0x20, 0x4C, 0x4C,
38                       0x56, 0x4D, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69,
39                       0x6F, 0x6E, 0x20, 0x38, 0x2E, 0x30, 0x2E, 0x30,
40                       0x20, 0x28, 0x63, 0x6C, 0x61, 0x6E, 0x67, 0x2D,
41                       0x38, 0x30, 0x30, 0x2E, 0x30, 0x2E, 0x32, 0x34,
42                       0x2E, 0x31, 0x29, 0x00, 0x68, 0x77, 0x2E, 0x63,
43                       0x00, 0x2F, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2F,
44                       0x6C, 0x68, 0x61, 0x6D, 0x65, 0x73, 0x2F, 0x50,
45                       0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x73, 0x2F,
46                       0x6C, 0x6C, 0x64, 0x2F, 0x6C, 0x6C, 0x64, 0x2D,
47                       0x73, 0x76, 0x6E, 0x2D, 0x74, 0x6F, 0x74, 0x2F,
48                       0x73, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x00,
49                       0x6D, 0x61, 0x69, 0x6E, 0x00, 0x69, 0x6E, 0x74,
50                       0x00, 0x61, 0x72, 0x67, 0x63, 0x00, 0x61, 0x72,
51                       0x67, 0x76, 0x00, 0x63, 0x68, 0x61, 0x72, 0x00 ]
52  - segment:         __DWARF
53    section:         __debug_loc
54    type:            S_REGULAR
55    attributes:      [ S_ATTR_DEBUG ]
56    address:         0x000000000000008E
57  - segment:         __DWARF
58    section:         __debug_abbrev
59    type:            S_REGULAR
60    attributes:      [ S_ATTR_DEBUG ]
61    address:         0x000000000000008E
62    content:         [ 0x01, 0x11, 0x01, 0x25, 0x0E, 0x13, 0x05, 0x03,
63                       0x0E, 0x10, 0x06, 0x1B, 0x0E, 0x11, 0x01, 0x12,
64                       0x01, 0x00, 0x00, 0x02, 0x2E, 0x01, 0x11, 0x01,
65                       0x12, 0x01, 0x40, 0x0A, 0x03, 0x0E, 0x3A, 0x0B,
66                       0x3B, 0x0B, 0x27, 0x0C, 0x49, 0x13, 0x3F, 0x0C,
67                       0x00, 0x00, 0x03, 0x05, 0x00, 0x02, 0x0A, 0x03,
68                       0x0E, 0x3A, 0x0B, 0x3B, 0x0B, 0x49, 0x13, 0x00,
69                       0x00, 0x04, 0x24, 0x00, 0x03, 0x0E, 0x3E, 0x0B,
70                       0x0B, 0x0B, 0x00, 0x00, 0x05, 0x0F, 0x00, 0x49,
71                       0x13, 0x00, 0x00, 0x00 ]
72  - segment:         __DWARF
73    section:         __debug_info
74    type:            S_REGULAR
75    attributes:      [ S_ATTR_DEBUG ]
76    address:         0x00000000000000DA
77    content:         [ 0x7F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
78                       0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00,
79                       0x0C, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00,
80                       0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
81                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00,
82                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
83                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16,
84                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
85                       0x56, 0x60, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
86                       0x6A, 0x00, 0x00, 0x00, 0x01, 0x03, 0x02, 0x91,
87                       0x78, 0x69, 0x00, 0x00, 0x00, 0x01, 0x01, 0x6A,
88                       0x00, 0x00, 0x00, 0x03, 0x02, 0x91, 0x70, 0x6E,
89                       0x00, 0x00, 0x00, 0x01, 0x01, 0x71, 0x00, 0x00,
90                       0x00, 0x00, 0x04, 0x65, 0x00, 0x00, 0x00, 0x05,
91                       0x04, 0x05, 0x76, 0x00, 0x00, 0x00, 0x05, 0x7B,
92                       0x00, 0x00, 0x00, 0x04, 0x73, 0x00, 0x00, 0x00,
93                       0x06, 0x01, 0x00 ]
94    relocations:
95      - offset:          0x00000037
96        type:            X86_64_RELOC_UNSIGNED
97        length:          3
98        pc-rel:          false
99        extern:          false
100        symbol:          1
101      - offset:          0x0000002F
102        type:            X86_64_RELOC_UNSIGNED
103        length:          3
104        pc-rel:          false
105        extern:          false
106        symbol:          1
107      - offset:          0x00000026
108        type:            X86_64_RELOC_UNSIGNED
109        length:          3
110        pc-rel:          false
111        extern:          false
112        symbol:          1
113      - offset:          0x0000001E
114        type:            X86_64_RELOC_UNSIGNED
115        length:          3
116        pc-rel:          false
117        extern:          false
118        symbol:          1
119  - segment:         __DWARF
120    section:         __debug_ranges
121    type:            S_REGULAR
122    attributes:      [ S_ATTR_DEBUG ]
123    address:         0x000000000000015D
124  - segment:         __DWARF
125    section:         __debug_macinfo
126    type:            S_REGULAR
127    attributes:      [ S_ATTR_DEBUG ]
128    address:         0x000000000000015D
129    content:         [ 0x00 ]
130  - segment:         __DWARF
131    section:         __apple_names
132    type:            S_REGULAR
133    attributes:      [ S_ATTR_DEBUG ]
134    address:         0x000000000000015E
135    content:         [ 0x48, 0x53, 0x41, 0x48, 0x01, 0x00, 0x00, 0x00,
136                       0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
137                       0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138                       0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00,
139                       0x00, 0x00, 0x00, 0x00, 0x6A, 0x7F, 0x9A, 0x7C,
140                       0x2C, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
141                       0x01, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00,
142                       0x00, 0x00, 0x00, 0x00 ]
143  - segment:         __DWARF
144    section:         __apple_objc
145    type:            S_REGULAR
146    attributes:      [ S_ATTR_DEBUG ]
147    address:         0x000000000000019A
148    content:         [ 0x48, 0x53, 0x41, 0x48, 0x01, 0x00, 0x00, 0x00,
149                       0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
150                       0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
151                       0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00,
152                       0xFF, 0xFF, 0xFF, 0xFF ]
153  - segment:         __DWARF
154    section:         __apple_namespac
155    type:            S_REGULAR
156    attributes:      [ S_ATTR_DEBUG ]
157    address:         0x00000000000001BE
158    content:         [ 0x48, 0x53, 0x41, 0x48, 0x01, 0x00, 0x00, 0x00,
159                       0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
160                       0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
161                       0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00,
162                       0xFF, 0xFF, 0xFF, 0xFF ]
163  - segment:         __DWARF
164    section:         __apple_types
165    type:            S_REGULAR
166    attributes:      [ S_ATTR_DEBUG ]
167    address:         0x00000000000001E2
168    content:         [ 0x48, 0x53, 0x41, 0x48, 0x01, 0x00, 0x00, 0x00,
169                       0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
170                       0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171                       0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00,
172                       0x03, 0x00, 0x05, 0x00, 0x04, 0x00, 0x0B, 0x00,
173                       0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
174                       0x30, 0x80, 0x88, 0x0B, 0x63, 0x20, 0x95, 0x7C,
175                       0x40, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00,
176                       0x65, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
177                       0x6A, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
178                       0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x01,
179                       0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x24,
180                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
181  - segment:         __DWARF
182    section:         __apple_exttypes
183    type:            S_REGULAR
184    attributes:      [ S_ATTR_DEBUG ]
185    address:         0x0000000000000248
186    content:         [ 0x48, 0x53, 0x41, 0x48, 0x01, 0x00, 0x00, 0x00,
187                       0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
188                       0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
189                       0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00,
190                       0xFF, 0xFF, 0xFF, 0xFF ]
191  - segment:         __LD
192    section:         __compact_unwind
193    type:            S_REGULAR
194    attributes:      [ S_ATTR_DEBUG ]
195    alignment:       8
196    address:         0x0000000000000270
197    content:         [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198                       0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
199                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
200                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
201    relocations:
202      - offset:          0x00000000
203        type:            X86_64_RELOC_UNSIGNED
204        length:          3
205        pc-rel:          false
206        extern:          false
207        symbol:          1
208  - segment:         __TEXT
209    section:         __eh_frame
210    type:            S_COALESCED
211    attributes:      [  ]
212    alignment:       8
213    address:         0x0000000000000290
214    content:         [ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215                       0x01, 0x7A, 0x52, 0x00, 0x01, 0x78, 0x10, 0x01,
216                       0x10, 0x0C, 0x07, 0x08, 0x90, 0x01, 0x00, 0x00,
217                       0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
218                       0x50, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
219                       0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220                       0x00, 0x41, 0x0E, 0x10, 0x86, 0x02, 0x43, 0x0D,
221                       0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
222  - segment:         __DWARF
223    section:         __debug_line
224    type:            S_REGULAR
225    attributes:      [ S_ATTR_DEBUG ]
226    address:         0x00000000000002D0
227    content:         [ 0x37, 0x00, 0x00, 0x00, 0x02, 0x00, 0x1B, 0x00,
228                       0x00, 0x00, 0x01, 0x01, 0xFB, 0x0E, 0x0D, 0x00,
229                       0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01,
230                       0x00, 0x00, 0x01, 0x00, 0x68, 0x77, 0x2E, 0x63,
231                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02,
232                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
233                       0x01, 0x05, 0x03, 0x0A, 0x08, 0x3D, 0x02, 0x02,
234                       0x00, 0x01, 0x01 ]
235    relocations:
236      - offset:          0x00000028
237        type:            X86_64_RELOC_UNSIGNED
238        length:          3
239        pc-rel:          false
240        extern:          false
241        symbol:          1
242global-symbols:
243  - name:            _main
244    type:            N_SECT
245    scope:           [ N_EXT ]
246    sect:            1
247    value:           0x0000000000000000
248page-size:       0x00000000
249...
250