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: 00000016 False hi/thm n/a HALFDIF True 0x00000064
7 # OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000001a half = 0x0046
8 # OBJDUMP-VERIFY-NEXT: 00000012 False lo/arm n/a HALFDIF True 0x00000064
9 # OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000001a half = 0x0000
10 # OBJDUMP-VERIFY-NEXT: 0000000a False hi/thm n/a HALFDIF True 0x0000005c
11 # OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000000e half = 0x004a
12 # OBJDUMP-VERIFY-NEXT: 00000006 False lo/arm n/a HALFDIF True 0x0000005c
13 # OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000000e half = 0x0000
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: 00000028 True long False T_BR22 False 2 (__TEXT,__StaticInit)
17 # OBJDUMP-VERIFY-NEXT: 0000001a False hi/thm n/a HALFDIF True 0x00000064
18 # OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x00000042 half = 0x001e
19 # OBJDUMP-VERIFY-NEXT: 00000016 False lo/arm n/a HALFDIF True 0x00000064
20 # OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x00000042 half = 0x0000
21 # OBJDUMP-VERIFY-NEXT: 0000000e False hi/thm n/a HALFDIF True 0x00000054
22 # OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x00000036 half = 0x001a
23 # OBJDUMP-VERIFY-NEXT: 0000000a False lo/arm n/a HALFDIF True 0x00000054
24 # OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x00000036 half = 0x0000
25 # OBJDUMP-VERIFY-NEXT: 00000004 False hi/thm n/a HALFDIF True 0x00000058
26 # OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000002c half = 0x0028
27 # OBJDUMP-VERIFY-NEXT: 00000000 False lo/arm n/a HALFDIF True 0x00000058
28 # OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000002c half = 0x0000
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 VANILLA False 3 (__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 VANILLA False 2 (__TEXT,__StaticInit)
36 # RUN: obj2yaml %t | FileCheck %s
38 # CHECK-NEXT: - sectname: __text
39 # CHECK-NEXT: segname: __TEXT
40 # CHECK-NEXT: addr: 0x0
41 # CHECK-NEXT: size: 36
42 # CHECK-NEXT: offset: 0x220
43 # CHECK-NEXT: align: 1
44 # CHECK-NEXT: reloff: 0x284
45 # CHECK-NEXT: nreloc: 8
46 # CHECK-NEXT: flags: 0x80000400
47 # CHECK-NEXT: reserved1: 0x0
48 # CHECK-NEXT: reserved2: 0x0
49 # CHECK-NEXT: reserved3: 0x0
50 # CHECK-NEXT: content:
51 # CHECK-NEXT: relocations:
52 # CHECK-NEXT: - address: 0x16
53 # CHECK-NEXT: symbolnum: 0
54 # CHECK-NEXT: pcrel: false
55 # CHECK-NEXT: length: 3
56 # CHECK-NEXT: extern: false
58 # CHECK-NEXT: scattered: true
59 # CHECK-NEXT: value: 100
60 # CHECK-NEXT: - address: 0x46
61 # CHECK-NEXT: symbolnum: 0
62 # CHECK-NEXT: pcrel: false
63 # CHECK-NEXT: length: 3
64 # CHECK-NEXT: extern: false
66 # CHECK-NEXT: scattered: true
67 # CHECK-NEXT: value: 26
68 # CHECK-NEXT: - address: 0x12
69 # CHECK-NEXT: symbolnum: 0
70 # CHECK-NEXT: pcrel: false
71 # CHECK-NEXT: length: 2
72 # CHECK-NEXT: extern: false
74 # CHECK-NEXT: scattered: true
75 # CHECK-NEXT: value: 100
76 # CHECK-NEXT: - address: 0x0
77 # CHECK-NEXT: symbolnum: 0
78 # CHECK-NEXT: pcrel: false
79 # CHECK-NEXT: length: 2
80 # CHECK-NEXT: extern: false
82 # CHECK-NEXT: scattered: true
83 # CHECK-NEXT: value: 26
84 # CHECK-NEXT: - address: 0xA
85 # CHECK-NEXT: symbolnum: 0
86 # CHECK-NEXT: pcrel: false
87 # CHECK-NEXT: length: 3
88 # CHECK-NEXT: extern: false
90 # CHECK-NEXT: scattered: true
91 # CHECK-NEXT: value: 92
92 # CHECK-NEXT: - address: 0x4A
93 # CHECK-NEXT: symbolnum: 0
94 # CHECK-NEXT: pcrel: false
95 # CHECK-NEXT: length: 3
96 # CHECK-NEXT: extern: false
98 # CHECK-NEXT: scattered: true
99 # CHECK-NEXT: value: 14
100 # CHECK-NEXT: - address: 0x6
101 # CHECK-NEXT: symbolnum: 0
102 # CHECK-NEXT: pcrel: false
103 # CHECK-NEXT: length: 2
104 # CHECK-NEXT: extern: false
105 # CHECK-NEXT: type: 9
106 # CHECK-NEXT: scattered: true
107 # CHECK-NEXT: value: 92
108 # CHECK-NEXT: - address: 0x0
109 # CHECK-NEXT: symbolnum: 0
110 # CHECK-NEXT: pcrel: false
111 # CHECK-NEXT: length: 2
112 # CHECK-NEXT: extern: false
113 # CHECK-NEXT: type: 1
114 # CHECK-NEXT: scattered: true
115 # CHECK-NEXT: value: 14
116 # CHECK-NEXT: - sectname: __StaticInit
117 # CHECK-NEXT: segname: __TEXT
118 # CHECK-NEXT: addr: 0x24
119 # CHECK-NEXT: size: 46
120 # CHECK-NEXT: offset: 0x244
121 # CHECK-NEXT: align: 1
122 # CHECK-NEXT: reloff: 0x2C4
123 # CHECK-NEXT: nreloc: 13
124 # CHECK-NEXT: flags: 0x80000400
125 # CHECK-NEXT: reserved1: 0x0
126 # CHECK-NEXT: reserved2: 0x0
127 # CHECK-NEXT: reserved3: 0x0
128 # CHECK-NEXT: content:
129 # CHECK-NEXT: relocations:
130 # CHECK-NEXT: - address: 0x28
131 # CHECK-NEXT: symbolnum: 2
132 # CHECK-NEXT: pcrel: true
133 # CHECK-NEXT: length: 2
134 # CHECK-NEXT: extern: false
135 # CHECK-NEXT: type: 6
136 # CHECK-NEXT: scattered: false
137 # CHECK-NEXT: value: 0
138 # CHECK-NEXT: - address: 0x1A
139 # CHECK-NEXT: symbolnum: 0
140 # CHECK-NEXT: pcrel: false
141 # CHECK-NEXT: length: 3
142 # CHECK-NEXT: extern: false
143 # CHECK-NEXT: type: 9
144 # CHECK-NEXT: scattered: true
145 # CHECK-NEXT: value: 100
146 # CHECK-NEXT: - address: 0x1E
147 # CHECK-NEXT: symbolnum: 0
148 # CHECK-NEXT: pcrel: false
149 # CHECK-NEXT: length: 3
150 # CHECK-NEXT: extern: false
151 # CHECK-NEXT: type: 1
152 # CHECK-NEXT: scattered: true
153 # CHECK-NEXT: value: 66
154 # CHECK-NEXT: - address: 0x16
155 # CHECK-NEXT: symbolnum: 0
156 # CHECK-NEXT: pcrel: false
157 # CHECK-NEXT: length: 2
158 # CHECK-NEXT: extern: false
159 # CHECK-NEXT: type: 9
160 # CHECK-NEXT: scattered: true
161 # CHECK-NEXT: value: 100
162 # CHECK-NEXT: - address: 0x0
163 # CHECK-NEXT: symbolnum: 0
164 # CHECK-NEXT: pcrel: false
165 # CHECK-NEXT: length: 2
166 # CHECK-NEXT: extern: false
167 # CHECK-NEXT: type: 1
168 # CHECK-NEXT: scattered: true
169 # CHECK-NEXT: value: 66
170 # CHECK-NEXT: - address: 0xE
171 # CHECK-NEXT: symbolnum: 0
172 # CHECK-NEXT: pcrel: false
173 # CHECK-NEXT: length: 3
174 # CHECK-NEXT: extern: false
175 # CHECK-NEXT: type: 9
176 # CHECK-NEXT: scattered: true
177 # CHECK-NEXT: value: 84
178 # CHECK-NEXT: - address: 0x1A
179 # CHECK-NEXT: symbolnum: 0
180 # CHECK-NEXT: pcrel: false
181 # CHECK-NEXT: length: 3
182 # CHECK-NEXT: extern: false
183 # CHECK-NEXT: type: 1
184 # CHECK-NEXT: scattered: true
185 # CHECK-NEXT: value: 54
186 # CHECK-NEXT: - address: 0xA
187 # CHECK-NEXT: symbolnum: 0
188 # CHECK-NEXT: pcrel: false
189 # CHECK-NEXT: length: 2
190 # CHECK-NEXT: extern: false
191 # CHECK-NEXT: type: 9
192 # CHECK-NEXT: scattered: true
193 # CHECK-NEXT: value: 84
194 # CHECK-NEXT: - address: 0x0
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: 54
202 # CHECK-NEXT: - address: 0x4
203 # CHECK-NEXT: symbolnum: 0
204 # CHECK-NEXT: pcrel: false
205 # CHECK-NEXT: length: 3
206 # CHECK-NEXT: extern: false
207 # CHECK-NEXT: type: 9
208 # CHECK-NEXT: scattered: true
209 # CHECK-NEXT: value: 88
210 # CHECK-NEXT: - address: 0x28
211 # CHECK-NEXT: symbolnum: 0
212 # CHECK-NEXT: pcrel: false
213 # CHECK-NEXT: length: 3
214 # CHECK-NEXT: extern: false
215 # CHECK-NEXT: type: 1
216 # CHECK-NEXT: scattered: true
217 # CHECK-NEXT: value: 44
218 # CHECK-NEXT: - address: 0x0
219 # CHECK-NEXT: symbolnum: 0
220 # CHECK-NEXT: pcrel: false
221 # CHECK-NEXT: length: 2
222 # CHECK-NEXT: extern: false
223 # CHECK-NEXT: type: 9
224 # CHECK-NEXT: scattered: true
225 # CHECK-NEXT: value: 88
226 # CHECK-NEXT: - address: 0x0
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: 44
234 # CHECK-NEXT: - sectname: __data
235 # CHECK-NEXT: segname: __DATA
236 # CHECK-NEXT: addr: 0x54
237 # CHECK-NEXT: size: 12
238 # CHECK-NEXT: offset: 0x274
239 # CHECK-NEXT: align: 2
240 # CHECK-NEXT: reloff: 0x32C
241 # CHECK-NEXT: nreloc: 1
242 # CHECK-NEXT: flags: 0x0
243 # CHECK-NEXT: reserved1: 0x0
244 # CHECK-NEXT: reserved2: 0x0
245 # CHECK-NEXT: reserved3: 0x0
246 # CHECK-NEXT: content:
247 # CHECK-NEXT: relocations:
248 # CHECK-NEXT: - address: 0x8
249 # CHECK-NEXT: symbolnum: 3
250 # CHECK-NEXT: pcrel: false
251 # CHECK-NEXT: length: 2
252 # CHECK-NEXT: extern: false
253 # CHECK-NEXT: type: 0
254 # CHECK-NEXT: scattered: false
255 # CHECK-NEXT: value: 0
256 # CHECK-NEXT: - sectname: __common
257 # CHECK-NEXT: segname: __DATA
258 # CHECK-NEXT: addr: 0x64
259 # CHECK-NEXT: size: 4
260 # CHECK-NEXT: offset: 0x0
261 # CHECK-NEXT: align: 2
262 # CHECK-NEXT: reloff: 0x0
263 # CHECK-NEXT: nreloc: 0
264 # CHECK-NEXT: flags: 0x1
265 # CHECK-NEXT: reserved1: 0x0
266 # CHECK-NEXT: reserved2: 0x0
267 # CHECK-NEXT: reserved3: 0x0
268 # CHECK-NEXT: - sectname: __mod_init_func
269 # CHECK-NEXT: segname: __DATA
270 # CHECK-NEXT: addr: 0x60
271 # CHECK-NEXT: size: 4
272 # CHECK-NEXT: offset: 0x280
273 # CHECK-NEXT: align: 2
274 # CHECK-NEXT: reloff: 0x334
275 # CHECK-NEXT: nreloc: 1
276 # CHECK-NEXT: flags: 0x9
277 # CHECK-NEXT: reserved1: 0x0
278 # CHECK-NEXT: reserved2: 0x0
279 # CHECK-NEXT: reserved3: 0x0
280 # CHECK-NEXT: content: '48000000'
281 # CHECK-NEXT: relocations:
282 # CHECK-NEXT: - address: 0x0
283 # CHECK-NEXT: symbolnum: 2
284 # CHECK-NEXT: pcrel: false
285 # CHECK-NEXT: length: 2
286 # CHECK-NEXT: extern: false
287 # CHECK-NEXT: type: 0
288 # CHECK-NEXT: scattered: false
289 # CHECK-NEXT: value: 0
295 cpusubtype: 0x00000009
315 addr: 0x0000000000000000
322 reserved1: 0x00000000
323 reserved2: 0x00000000
324 reserved3: 0x00000000
325 content: 81B00020009040F24A00C0F200007844006840F24601C0F2000179440968084401B07047
327 - address: 0x00000016
335 - address: 0x00000046
343 - address: 0x00000012
351 - address: 0x00000000
359 - address: 0x0000000A
367 - address: 0x0000004A
375 - address: 0x00000006
383 - address: 0x00000000
391 - sectname: __StaticInit
393 addr: 0x0000000000000024
400 reserved1: 0x00000000
401 reserved2: 0x00000000
402 reserved3: 0x00000000
403 content: 40F22800C0F20000784440F21A01C0F200017944081A40F21E01C0F2000179440860704780B56F46FFF7EAFF80BD
405 - address: 0x00000028
413 - address: 0x0000001A
421 - address: 0x0000001E
429 - address: 0x00000016
437 - address: 0x00000000
445 - address: 0x0000000E
453 - address: 0x0000001A
461 - address: 0x0000000A
469 - address: 0x00000000
477 - address: 0x00000004
485 - address: 0x00000028
493 - address: 0x00000000
501 - address: 0x00000000
511 addr: 0x0000000000000054
518 reserved1: 0x00000000
519 reserved2: 0x00000000
520 reserved3: 0x00000000
521 content: '010000000200000054000000'
523 - address: 0x00000008
533 addr: 0x0000000000000064
540 reserved1: 0x00000000
541 reserved2: 0x00000000
542 reserved3: 0x00000000
543 - sectname: __mod_init_func
545 addr: 0x0000000000000060
552 reserved1: 0x00000000
553 reserved2: 0x00000000
554 reserved3: 0x00000000
557 - address: 0x00000000
565 - cmd: LC_VERSION_MIN_IPHONEOS
638 - ___cxx_global_var_init
639 - __GLOBAL__sub_I_main.cpp