1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objdump --macho --reloc %t | FileCheck %s --check-prefix=OBJDUMP-VERIFY
4 # OBJDUMP-VERIFY: Relocation information (__TEXT,__text) 8 entries
5 # OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value
6 # OBJDUMP-VERIFY-NEXT: 00000030 False long n/a 11 True 0x00000144
7 # OBJDUMP-VERIFY-NEXT: 00000000 False long n/a 1 True 0x00000018
8 # OBJDUMP-VERIFY-NEXT: 0000002c False long n/a 12 True 0x00000144
9 # OBJDUMP-VERIFY-NEXT: 0000012c False long n/a 1 True 0x00000018
10 # OBJDUMP-VERIFY-NEXT: 00000028 False long n/a 11 True 0x000000d4
11 # OBJDUMP-VERIFY-NEXT: 00000000 False long n/a 1 True 0x00000018
12 # OBJDUMP-VERIFY-NEXT: 00000024 False long n/a 12 True 0x000000d4
13 # OBJDUMP-VERIFY-NEXT: 000000bc False long n/a 1 True 0x00000018
14 # OBJDUMP-VERIFY-NEXT: Relocation information (__TEXT,__StaticInit) 13 entries
15 # OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value
16 # OBJDUMP-VERIFY-NEXT: 00000064 True long False 3 False 4 (__TEXT,__StaticInit)
17 # OBJDUMP-VERIFY-NEXT: 00000034 False long n/a 11 True 0x00000144
18 # OBJDUMP-VERIFY-NEXT: 00000000 False long n/a 1 True 0x00000068
19 # OBJDUMP-VERIFY-NEXT: 00000030 False long n/a 12 True 0x00000144
20 # OBJDUMP-VERIFY-NEXT: 000000dc False long n/a 1 True 0x00000068
21 # OBJDUMP-VERIFY-NEXT: 00000028 False long n/a 11 True 0x000000d0
22 # OBJDUMP-VERIFY-NEXT: 00000000 False long n/a 1 True 0x00000068
23 # OBJDUMP-VERIFY-NEXT: 00000024 False long n/a 12 True 0x000000d0
24 # OBJDUMP-VERIFY-NEXT: 00000068 False long n/a 1 True 0x00000068
25 # OBJDUMP-VERIFY-NEXT: 00000020 False long n/a 11 True 0x000000cc
26 # OBJDUMP-VERIFY-NEXT: 00000000 False long n/a 1 True 0x00000068
27 # OBJDUMP-VERIFY-NEXT: 0000001c False long n/a 12 True 0x000000cc
28 # OBJDUMP-VERIFY-NEXT: 00000064 False long n/a 1 True 0x00000068
29 # OBJDUMP-VERIFY-NEXT: Relocation information (__DATA,__data) 1 entries
30 # OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value
31 # OBJDUMP-VERIFY-NEXT: 00000008 False long False 0 False 5 (__DATA,__data)
32 # OBJDUMP-VERIFY-NEXT: Relocation information (__DATA,__mod_init_func) 1 entries
33 # OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value
34 # OBJDUMP-VERIFY-NEXT: 00000000 False long False 0 False 4 (__TEXT,__StaticInit)
35 # OBJDUMP-VERIFY-NEXT: Relocation information (__TEXT,__eh_frame) 3 entries
36 # OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value
37 # OBJDUMP-VERIFY-NEXT: 00000054 False long n/a 0 True 0x000000a0
38 # OBJDUMP-VERIFY-NEXT: 00000038 False long n/a 0 True 0x00000000
39 # OBJDUMP-VERIFY-NEXT: 0000001c False long n/a 0 True 0x00000050
41 # RUN: obj2yaml %t | FileCheck %s
44 # CHECK-NEXT: - sectname: __text
45 # CHECK-NEXT: segname: __TEXT
46 # CHECK-NEXT: addr: 0x0
47 # CHECK-NEXT: size: 76
48 # CHECK-NEXT: offset: 0x2EC
49 # CHECK-NEXT: align: 4
50 # CHECK-NEXT: reloff: 0x430
51 # CHECK-NEXT: nreloc: 8
52 # CHECK-NEXT: flags: 0x80000400
53 # CHECK-NEXT: reserved1: 0x0
54 # CHECK-NEXT: reserved2: 0x0
55 # CHECK-NEXT: reserved3: 0x0
56 # CHECK-NEXT: content:
57 # CHECK-NEXT: relocations:
58 # CHECK-NEXT: - address: 0x30
59 # CHECK-NEXT: symbolnum: 0
60 # CHECK-NEXT: pcrel: false
61 # CHECK-NEXT: length: 2
62 # CHECK-NEXT: extern: false
63 # CHECK-NEXT: type: 11
64 # CHECK-NEXT: scattered: true
65 # CHECK-NEXT: value: 324
66 # CHECK-NEXT: - address: 0x0
67 # CHECK-NEXT: symbolnum: 0
68 # CHECK-NEXT: pcrel: false
69 # CHECK-NEXT: length: 2
70 # CHECK-NEXT: extern: false
72 # CHECK-NEXT: scattered: true
73 # CHECK-NEXT: value: 24
74 # CHECK-NEXT: - address: 0x2C
75 # CHECK-NEXT: symbolnum: 0
76 # CHECK-NEXT: pcrel: false
77 # CHECK-NEXT: length: 2
78 # CHECK-NEXT: extern: false
79 # CHECK-NEXT: type: 12
80 # CHECK-NEXT: scattered: true
81 # CHECK-NEXT: value: 324
82 # CHECK-NEXT: - address: 0x12C
83 # CHECK-NEXT: symbolnum: 0
84 # CHECK-NEXT: pcrel: false
85 # CHECK-NEXT: length: 2
86 # CHECK-NEXT: extern: false
88 # CHECK-NEXT: scattered: true
89 # CHECK-NEXT: value: 24
90 # CHECK-NEXT: - address: 0x28
91 # CHECK-NEXT: symbolnum: 0
92 # CHECK-NEXT: pcrel: false
93 # CHECK-NEXT: length: 2
94 # CHECK-NEXT: extern: false
95 # CHECK-NEXT: type: 11
96 # CHECK-NEXT: scattered: true
97 # CHECK-NEXT: value: 212
98 # CHECK-NEXT: - address: 0x0
99 # CHECK-NEXT: symbolnum: 0
100 # CHECK-NEXT: pcrel: false
101 # CHECK-NEXT: length: 2
102 # CHECK-NEXT: extern: false
103 # CHECK-NEXT: type: 1
104 # CHECK-NEXT: scattered: true
105 # CHECK-NEXT: value: 24
106 # CHECK-NEXT: - address: 0x24
107 # CHECK-NEXT: symbolnum: 0
108 # CHECK-NEXT: pcrel: false
109 # CHECK-NEXT: length: 2
110 # CHECK-NEXT: extern: false
111 # CHECK-NEXT: type: 12
112 # CHECK-NEXT: scattered: true
113 # CHECK-NEXT: value: 212
114 # CHECK-NEXT: - address: 0xBC
115 # CHECK-NEXT: symbolnum: 0
116 # CHECK-NEXT: pcrel: false
117 # CHECK-NEXT: length: 2
118 # CHECK-NEXT: extern: false
119 # CHECK-NEXT: type: 1
120 # CHECK-NEXT: scattered: true
121 # CHECK-NEXT: value: 24
122 # CHECK-NEXT: - sectname: __textcoal_nt
123 # CHECK-NEXT: segname: __TEXT
124 # CHECK-NEXT: addr: 0x4C
125 # CHECK-NEXT: size: 0
126 # CHECK-NEXT: offset: 0x338
127 # CHECK-NEXT: align: 0
128 # CHECK-NEXT: reloff: 0x0
129 # CHECK-NEXT: nreloc: 0
130 # CHECK-NEXT: flags: 0x8000000B
131 # CHECK-NEXT: reserved1: 0x0
132 # CHECK-NEXT: reserved2: 0x0
133 # CHECK-NEXT: reserved3: 0x0
134 # CHECK-NEXT: content: ''
135 # CHECK-NEXT: - sectname: __picsymbolstub1
136 # CHECK-NEXT: segname: __TEXT
137 # CHECK-NEXT: addr: 0x4C
138 # CHECK-NEXT: size: 0
139 # CHECK-NEXT: offset: 0x338
140 # CHECK-NEXT: align: 0
141 # CHECK-NEXT: reloff: 0x0
142 # CHECK-NEXT: nreloc: 0
143 # CHECK-NEXT: flags: 0x80000008
144 # CHECK-NEXT: reserved1: 0x0
145 # CHECK-NEXT: reserved2: 0x20
146 # CHECK-NEXT: reserved3: 0x0
147 # CHECK-NEXT: content: ''
148 # CHECK-NEXT: - sectname: __StaticInit
149 # CHECK-NEXT: segname: __TEXT
150 # CHECK-NEXT: addr: 0x50
151 # CHECK-NEXT: size: 124
152 # CHECK-NEXT: offset: 0x33C
153 # CHECK-NEXT: align: 4
154 # CHECK-NEXT: reloff: 0x470
155 # CHECK-NEXT: nreloc: 13
156 # CHECK-NEXT: flags: 0x80000400
157 # CHECK-NEXT: reserved1: 0x0
158 # CHECK-NEXT: reserved2: 0x0
159 # CHECK-NEXT: reserved3: 0x0
160 # CHECK-NEXT: content:
161 # CHECK-NEXT: relocations:
162 # CHECK-NEXT: - address: 0x64
163 # CHECK-NEXT: symbolnum: 4
164 # CHECK-NEXT: pcrel: true
165 # CHECK-NEXT: length: 2
166 # CHECK-NEXT: extern: false
167 # CHECK-NEXT: type: 3
168 # CHECK-NEXT: scattered: false
169 # CHECK-NEXT: value: 0
170 # CHECK-NEXT: - address: 0x34
171 # CHECK-NEXT: symbolnum: 0
172 # CHECK-NEXT: pcrel: false
173 # CHECK-NEXT: length: 2
174 # CHECK-NEXT: extern: false
175 # CHECK-NEXT: type: 11
176 # CHECK-NEXT: scattered: true
177 # CHECK-NEXT: value: 324
178 # CHECK-NEXT: - address: 0x0
179 # CHECK-NEXT: symbolnum: 0
180 # CHECK-NEXT: pcrel: false
181 # CHECK-NEXT: length: 2
182 # CHECK-NEXT: extern: false
183 # CHECK-NEXT: type: 1
184 # CHECK-NEXT: scattered: true
185 # CHECK-NEXT: value: 104
186 # CHECK-NEXT: - address: 0x30
187 # CHECK-NEXT: symbolnum: 0
188 # CHECK-NEXT: pcrel: false
189 # CHECK-NEXT: length: 2
190 # CHECK-NEXT: extern: false
191 # CHECK-NEXT: type: 12
192 # CHECK-NEXT: scattered: true
193 # CHECK-NEXT: value: 324
194 # CHECK-NEXT: - address: 0xDC
195 # CHECK-NEXT: symbolnum: 0
196 # CHECK-NEXT: pcrel: false
197 # CHECK-NEXT: length: 2
198 # CHECK-NEXT: extern: false
199 # CHECK-NEXT: type: 1
200 # CHECK-NEXT: scattered: true
201 # CHECK-NEXT: value: 104
202 # CHECK-NEXT: - address: 0x28
203 # CHECK-NEXT: symbolnum: 0
204 # CHECK-NEXT: pcrel: false
205 # CHECK-NEXT: length: 2
206 # CHECK-NEXT: extern: false
207 # CHECK-NEXT: type: 11
208 # CHECK-NEXT: scattered: true
209 # CHECK-NEXT: value: 208
210 # CHECK-NEXT: - address: 0x0
211 # CHECK-NEXT: symbolnum: 0
212 # CHECK-NEXT: pcrel: false
213 # CHECK-NEXT: length: 2
214 # CHECK-NEXT: extern: false
215 # CHECK-NEXT: type: 1
216 # CHECK-NEXT: scattered: true
217 # CHECK-NEXT: value: 104
218 # CHECK-NEXT: - address: 0x24
219 # CHECK-NEXT: symbolnum: 0
220 # CHECK-NEXT: pcrel: false
221 # CHECK-NEXT: length: 2
222 # CHECK-NEXT: extern: false
223 # CHECK-NEXT: type: 12
224 # CHECK-NEXT: scattered: true
225 # CHECK-NEXT: value: 208
226 # CHECK-NEXT: - address: 0x68
227 # CHECK-NEXT: symbolnum: 0
228 # CHECK-NEXT: pcrel: false
229 # CHECK-NEXT: length: 2
230 # CHECK-NEXT: extern: false
231 # CHECK-NEXT: type: 1
232 # CHECK-NEXT: scattered: true
233 # CHECK-NEXT: value: 104
234 # CHECK-NEXT: - address: 0x20
235 # CHECK-NEXT: symbolnum: 0
236 # CHECK-NEXT: pcrel: false
237 # CHECK-NEXT: length: 2
238 # CHECK-NEXT: extern: false
239 # CHECK-NEXT: type: 11
240 # CHECK-NEXT: scattered: true
241 # CHECK-NEXT: value: 204
242 # CHECK-NEXT: - address: 0x0
243 # CHECK-NEXT: symbolnum: 0
244 # CHECK-NEXT: pcrel: false
245 # CHECK-NEXT: length: 2
246 # CHECK-NEXT: extern: false
247 # CHECK-NEXT: type: 1
248 # CHECK-NEXT: scattered: true
249 # CHECK-NEXT: value: 104
250 # CHECK-NEXT: - address: 0x1C
251 # CHECK-NEXT: symbolnum: 0
252 # CHECK-NEXT: pcrel: false
253 # CHECK-NEXT: length: 2
254 # CHECK-NEXT: extern: false
255 # CHECK-NEXT: type: 12
256 # CHECK-NEXT: scattered: true
257 # CHECK-NEXT: value: 204
258 # CHECK-NEXT: - address: 0x64
259 # CHECK-NEXT: symbolnum: 0
260 # CHECK-NEXT: pcrel: false
261 # CHECK-NEXT: length: 2
262 # CHECK-NEXT: extern: false
263 # CHECK-NEXT: type: 1
264 # CHECK-NEXT: scattered: true
265 # CHECK-NEXT: value: 104
266 # CHECK-NEXT: - sectname: __data
267 # CHECK-NEXT: segname: __DATA
268 # CHECK-NEXT: addr: 0xCC
269 # CHECK-NEXT: size: 12
270 # CHECK-NEXT: offset: 0x3B8
271 # CHECK-NEXT: align: 2
272 # CHECK-NEXT: reloff: 0x4D8
273 # CHECK-NEXT: nreloc: 1
274 # CHECK-NEXT: flags: 0x0
275 # CHECK-NEXT: reserved1: 0x0
276 # CHECK-NEXT: reserved2: 0x0
277 # CHECK-NEXT: reserved3: 0x0
278 # CHECK-NEXT: content:
279 # CHECK-NEXT: relocations:
280 # CHECK-NEXT: - address: 0x8
281 # CHECK-NEXT: symbolnum: 5
282 # CHECK-NEXT: pcrel: false
283 # CHECK-NEXT: length: 2
284 # CHECK-NEXT: extern: false
285 # CHECK-NEXT: type: 0
286 # CHECK-NEXT: scattered: false
287 # CHECK-NEXT: value: 0
288 # CHECK-NEXT: - sectname: __common
289 # CHECK-NEXT: segname: __DATA
290 # CHECK-NEXT: addr: 0x144
291 # CHECK-NEXT: size: 4
292 # CHECK-NEXT: offset: 0x0
293 # CHECK-NEXT: align: 2
294 # CHECK-NEXT: reloff: 0x0
295 # CHECK-NEXT: nreloc: 0
296 # CHECK-NEXT: flags: 0x1
297 # CHECK-NEXT: reserved1: 0x0
298 # CHECK-NEXT: reserved2: 0x0
299 # CHECK-NEXT: reserved3: 0x0
300 # CHECK-NEXT: - sectname: __mod_init_func
301 # CHECK-NEXT: segname: __DATA
302 # CHECK-NEXT: addr: 0xD8
303 # CHECK-NEXT: size: 4
304 # CHECK-NEXT: offset: 0x3C4
305 # CHECK-NEXT: align: 2
306 # CHECK-NEXT: reloff: 0x4E0
307 # CHECK-NEXT: nreloc: 1
308 # CHECK-NEXT: flags: 0x9
309 # CHECK-NEXT: reserved1: 0x0
310 # CHECK-NEXT: reserved2: 0x0
311 # CHECK-NEXT: reserved3: 0x0
312 # CHECK-NEXT: content: 000000A0
313 # CHECK-NEXT: relocations:
314 # CHECK-NEXT: - address: 0x0
315 # CHECK-NEXT: symbolnum: 4
316 # CHECK-NEXT: pcrel: false
317 # CHECK-NEXT: length: 2
318 # CHECK-NEXT: extern: false
319 # CHECK-NEXT: type: 0
320 # CHECK-NEXT: scattered: false
321 # CHECK-NEXT: value: 0
322 # CHECK-NEXT: - sectname: __eh_frame
323 # CHECK-NEXT: segname: __TEXT
324 # CHECK-NEXT: addr: 0xDC
325 # CHECK-NEXT: size: 104
326 # CHECK-NEXT: offset: 0x3C8
327 # CHECK-NEXT: align: 2
328 # CHECK-NEXT: reloff: 0x4E8
329 # CHECK-NEXT: nreloc: 3
330 # CHECK-NEXT: flags: 0x6800000B
331 # CHECK-NEXT: reserved1: 0x0
332 # CHECK-NEXT: reserved2: 0x0
333 # CHECK-NEXT: reserved3: 0x0
334 # CHECK-NEXT: content:
335 # CHECK-NEXT: relocations:
336 # CHECK-NEXT: - address: 0x54
337 # CHECK-NEXT: symbolnum: 0
338 # CHECK-NEXT: pcrel: false
339 # CHECK-NEXT: length: 2
340 # CHECK-NEXT: extern: false
341 # CHECK-NEXT: type: 0
342 # CHECK-NEXT: scattered: true
343 # CHECK-NEXT: value: 160
344 # CHECK-NEXT: - address: 0x38
345 # CHECK-NEXT: symbolnum: 0
346 # CHECK-NEXT: pcrel: false
347 # CHECK-NEXT: length: 2
348 # CHECK-NEXT: extern: false
349 # CHECK-NEXT: type: 0
350 # CHECK-NEXT: scattered: true
351 # CHECK-NEXT: value: 0
352 # CHECK-NEXT: - address: 0x1C
353 # CHECK-NEXT: symbolnum: 0
354 # CHECK-NEXT: pcrel: false
355 # CHECK-NEXT: length: 2
356 # CHECK-NEXT: extern: false
357 # CHECK-NEXT: type: 0
358 # CHECK-NEXT: scattered: true
359 # CHECK-NEXT: value: 80
362 IsLittleEndian: false
366 cpusubtype: 0x00000000
386 addr: 0x0000000000000000
393 reserved1: 0x00000000
394 reserved2: 0x00000000
395 reserved3: 0x00000000
396 content: 7C0802A693E1FFFC900100089421FFE07C3F0B78480000057C4802A638600000907F00183C620000806300BC3C4200008042012C7C631214382100208001000883E1FFFC7C0803A64E800020
398 - address: 0x00000030
406 - address: 0x00000000
414 - address: 0x0000002C
422 - address: 0x0000012C
430 - address: 0x00000028
438 - address: 0x00000000
446 - address: 0x00000024
454 - address: 0x000000BC
462 - sectname: __textcoal_nt
464 addr: 0x000000000000004C
471 reserved1: 0x00000000
472 reserved2: 0x00000000
473 reserved3: 0x00000000
475 - sectname: __picsymbolstub1
477 addr: 0x000000000000004C
484 reserved1: 0x00000000
485 reserved2: 0x00000020
486 reserved3: 0x00000000
488 - sectname: __StaticInit
490 addr: 0x0000000000000050
497 reserved1: 0x00000000
498 reserved2: 0x00000000
499 reserved3: 0x00000000
500 content: 7C0802A693E1FFFC900100089421FFE07C3F0B78480000057C4802A63C620000386300643C820000388400687C6418503C420000906200DC382100208001000883E1FFFC7C0803A64E800020600000007C0802A693E1FFFC900100089421FFC07C3F0B784BFFFF9D382100408001000883E1FFFC7C0803A64E800020
502 - address: 0x00000064
510 - address: 0x00000034
518 - address: 0x00000000
526 - address: 0x00000030
534 - address: 0x000000DC
542 - address: 0x00000028
550 - address: 0x00000000
558 - address: 0x00000024
566 - address: 0x00000068
574 - address: 0x00000020
582 - address: 0x00000000
590 - address: 0x0000001C
598 - address: 0x00000064
608 addr: 0x00000000000000CC
615 reserved1: 0x00000000
616 reserved2: 0x00000000
617 reserved3: 0x00000000
618 content: 0000000100000002000000CC
620 - address: 0x00000008
630 addr: 0x0000000000000144
637 reserved1: 0x00000000
638 reserved2: 0x00000000
639 reserved3: 0x00000000
640 - sectname: __mod_init_func
642 addr: 0x00000000000000D8
649 reserved1: 0x00000000
650 reserved2: 0x00000000
651 reserved3: 0x00000000
654 - address: 0x00000000
662 - sectname: __eh_frame
664 addr: 0x00000000000000DC
671 reserved1: 0x00000000
672 reserved2: 0x00000000
673 reserved3: 0x00000000
674 content: 0000001000000000017A5200017C4101100C01000000001800000018FFFFFF580000004C00500E209F0111417E440D1F0000001800000034FFFFFEEC0000004C00500E209F0111417E440D1F0000001800000050FFFFFF700000002C00500E409F0111417E440D1F
676 - address: 0x00000054
684 - address: 0x00000038
692 - address: 0x0000001C
700 - cmd: LC_VERSION_MIN_MACOSX
773 - ___cxx_global_var_init
774 - __GLOBAL__sub_I_main.cpp