1 // RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
4 .reference sym_ref_def_A
7 .reference sym_ref_def_C
8 .reference sym_ref_def_D
11 .reference sym_ref_def_E
13 .weak_reference sym_weak_ref_A
14 .weak_reference sym_weak_ref_def_A
17 .weak_reference sym_weak_ref_def_B
21 .weak_definition sym_weak_def_A
24 .weak_definition sym_weak_def_B
26 .weak_definition sym_weak_def_C
30 .lazy_reference sym_lazy_ref_A
31 .lazy_reference sym_lazy_ref_B
34 .lazy_reference sym_lazy_ref_C
35 .lazy_reference sym_lazy_ref_D
38 .lazy_reference sym_lazy_ref_E
40 .private_extern sym_private_ext_A
41 .private_extern sym_private_ext_B
44 .private_extern sym_private_ext_C
45 .private_extern sym_private_ext_D
46 .globl sym_private_ext_D
47 .globl sym_private_ext_E
48 .private_extern sym_private_ext_E
50 .no_dead_strip sym_no_dead_strip_A
52 sym_symbol_resolver_A:
53 .symbol_resolver sym_symbol_resolver_A
57 .desc sym_ref_A, 0x1234
59 .desc sym_desc_flags,0x47
62 // CHECK: File: <stdin>
63 // CHECK: Format: Mach-O 32-bit i386
65 // CHECK: AddressSize: 32bit
66 // CHECK: MachHeader {
67 // CHECK: Magic: Magic (0xFEEDFACE)
68 // CHECK: CpuType: X86 (0x7)
69 // CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
70 // CHECK: FileType: Relocatable (0x1)
71 // CHECK: NumOfLoadCommands: 4
72 // CHECK: SizeOfLoadCommands: 312
73 // CHECK: Flags [ (0x0)
79 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
80 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
81 // CHECK: Address: 0x0
84 // CHECK: Alignment: 0
85 // CHECK: RelocationOffset: 0x0
86 // CHECK: RelocationCount: 0
88 // CHECK: Attributes [ (0x800000)
89 // CHECK: PureInstructions (0x800000)
91 // CHECK: Reserved1: 0x0
92 // CHECK: Reserved2: 0x0
96 // CHECK: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
97 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
98 // CHECK: Address: 0x0
100 // CHECK: Offset: 340
101 // CHECK: Alignment: 0
102 // CHECK: RelocationOffset: 0x0
103 // CHECK: RelocationCount: 0
105 // CHECK: Attributes [ (0x0)
107 // CHECK: Reserved1: 0x0
108 // CHECK: Reserved2: 0x0
111 // CHECK: Relocations [
115 // CHECK: Name: sym_ref_def_A (354)
116 // CHECK: Type: Section (0xE)
117 // CHECK: Section: __text (0x1)
118 // CHECK: RefType: UndefinedNonLazy (0x0)
119 // CHECK: Flags [ (0x20)
120 // CHECK: NoDeadStrip (0x20)
125 // CHECK: Name: sym_ref_def_C (158)
126 // CHECK: Type: Section (0xE)
127 // CHECK: Section: __text (0x1)
128 // CHECK: RefType: UndefinedNonLazy (0x0)
129 // CHECK: Flags [ (0x20)
130 // CHECK: NoDeadStrip (0x20)
135 // CHECK: Name: sym_weak_ref_def_A (368)
136 // CHECK: Type: Section (0xE)
137 // CHECK: Section: __text (0x1)
138 // CHECK: RefType: UndefinedNonLazy (0x0)
139 // CHECK: Flags [ (0x40)
140 // CHECK: WeakRef (0x40)
145 // CHECK: Name: sym_weak_ref_def_B (220)
146 // CHECK: Type: Section (0xE)
147 // CHECK: Section: __text (0x1)
148 // CHECK: RefType: UndefinedNonLazy (0x0)
149 // CHECK: Flags [ (0x0)
154 // CHECK: Name: sym_lazy_ref_B (190)
155 // CHECK: Type: Section (0xE)
156 // CHECK: Section: __data (0x2)
157 // CHECK: RefType: UndefinedNonLazy (0x0)
158 // CHECK: Flags [ (0x20)
159 // CHECK: NoDeadStrip (0x20)
164 // CHECK: Name: sym_lazy_ref_C (128)
165 // CHECK: Type: Section (0xE)
166 // CHECK: Section: __data (0x2)
167 // CHECK: RefType: UndefinedNonLazy (0x0)
168 // CHECK: Flags [ (0x20)
169 // CHECK: NoDeadStrip (0x20)
174 // CHECK: Name: sym_symbol_resolver_A (257)
175 // CHECK: Type: Section (0xE)
176 // CHECK: Section: __data (0x2)
177 // CHECK: RefType: UndefinedNonLazy (0x0)
178 // CHECK: Flags [ (0x100)
183 // CHECK: Name: sym_desc_flags (1)
184 // CHECK: Type: Section (0xE)
185 // CHECK: Section: __data (0x2)
186 // CHECK: RefType: UndefinedNonLazy (0x0)
187 // CHECK: Flags [ (0x40)
188 // CHECK: WeakRef (0x40)
193 // CHECK: Name: sym_private_ext_B (172)
194 // CHECK: PrivateExtern
196 // CHECK: Type: Section (0xE)
197 // CHECK: Section: __data (0x2)
198 // CHECK: RefType: UndefinedNonLazy (0x0)
199 // CHECK: Flags [ (0x0)
204 // CHECK: Name: sym_private_ext_C (110)
205 // CHECK: PrivateExtern
207 // CHECK: Type: Section (0xE)
208 // CHECK: Section: __data (0x2)
209 // CHECK: RefType: UndefinedNonLazy (0x0)
210 // CHECK: Flags [ (0x0)
215 // CHECK: Name: sym_weak_def_A (339)
217 // CHECK: Type: Section (0xE)
218 // CHECK: Section: __data (0x2)
219 // CHECK: RefType: UndefinedNonLazy (0x0)
220 // CHECK: Flags [ (0x80)
221 // CHECK: WeakDef (0x80)
226 // CHECK: Name: sym_weak_def_B (205)
228 // CHECK: Type: Section (0xE)
229 // CHECK: Section: __data (0x2)
230 // CHECK: RefType: UndefinedNonLazy (0x0)
231 // CHECK: Flags [ (0x80)
232 // CHECK: WeakDef (0x80)
237 // CHECK: Name: sym_weak_def_C (143)
239 // CHECK: Type: Section (0xE)
240 // CHECK: Section: __data (0x2)
241 // CHECK: RefType: UndefinedNonLazy (0x0)
242 // CHECK: Flags [ (0x80)
243 // CHECK: WeakDef (0x80)
248 // CHECK: Name: sym_lazy_ref_A (299)
250 // CHECK: Type: Undef (0x0)
251 // CHECK: Section: (0x0)
252 // CHECK: RefType: ReferenceFlagUndefinedLazy (0x1)
253 // CHECK: Flags [ (0x20)
254 // CHECK: NoDeadStrip (0x20)
259 // CHECK: Name: sym_lazy_ref_D (81)
261 // CHECK: Type: Undef (0x0)
262 // CHECK: Section: (0x0)
263 // CHECK: RefType: UndefinedNonLazy (0x0)
264 // CHECK: Flags [ (0x20)
265 // CHECK: NoDeadStrip (0x20)
270 // CHECK: Name: sym_lazy_ref_E (34)
272 // CHECK: Type: Undef (0x0)
273 // CHECK: Section: (0x0)
274 // CHECK: RefType: ReferenceFlagUndefinedLazy (0x1)
275 // CHECK: Flags [ (0x20)
276 // CHECK: NoDeadStrip (0x20)
281 // CHECK: Name: sym_no_dead_strip_A (279)
283 // CHECK: Type: Undef (0x0)
284 // CHECK: Section: (0x0)
285 // CHECK: RefType: UndefinedNonLazy (0x0)
286 // CHECK: Flags [ (0x20)
287 // CHECK: NoDeadStrip (0x20)
292 // CHECK: Name: sym_private_ext_A (239)
293 // CHECK: PrivateExtern
295 // CHECK: Type: Undef (0x0)
296 // CHECK: Section: (0x0)
297 // CHECK: RefType: UndefinedNonLazy (0x0)
298 // CHECK: Flags [ (0x0)
303 // CHECK: Name: sym_private_ext_D (63)
304 // CHECK: PrivateExtern
306 // CHECK: Type: Undef (0x0)
307 // CHECK: Section: (0x0)
308 // CHECK: RefType: UndefinedNonLazy (0x0)
309 // CHECK: Flags [ (0x0)
314 // CHECK: Name: sym_private_ext_E (16)
315 // CHECK: PrivateExtern
317 // CHECK: Type: Undef (0x0)
318 // CHECK: Section: (0x0)
319 // CHECK: RefType: UndefinedNonLazy (0x0)
320 // CHECK: Flags [ (0x0)
325 // CHECK: Name: sym_ref_A (314)
327 // CHECK: Type: Undef (0x0)
328 // CHECK: Section: (0x0)
329 // CHECK: RefType: ReferenceFlagPrivateUndefinedNonLazy (0x4)
330 // CHECK: Flags [ (0x1230)
331 // CHECK: NoDeadStrip (0x20)
332 // CHECK: ReferencedDynamically (0x10)
337 // CHECK: Name: sym_ref_def_D (96)
339 // CHECK: Type: Undef (0x0)
340 // CHECK: Section: (0x0)
341 // CHECK: RefType: UndefinedNonLazy (0x0)
342 // CHECK: Flags [ (0x20)
343 // CHECK: NoDeadStrip (0x20)
348 // CHECK: Name: sym_ref_def_E (49)
350 // CHECK: Type: Undef (0x0)
351 // CHECK: Section: (0x0)
352 // CHECK: RefType: UndefinedNonLazy (0x0)
353 // CHECK: Flags [ (0x20)
354 // CHECK: NoDeadStrip (0x20)
359 // CHECK: Name: sym_weak_ref_A (324)
361 // CHECK: Type: Undef (0x0)
362 // CHECK: Section: (0x0)
363 // CHECK: RefType: UndefinedNonLazy (0x0)
364 // CHECK: Flags [ (0x40)
365 // CHECK: WeakRef (0x40)
370 // CHECK: Indirect Symbols {
376 // CHECK: Cmd: LC_SEGMENT
379 // CHECK: vmaddr: 0x0
380 // CHECK: vmsize: 0x0
381 // CHECK: fileoff: 340
382 // CHECK: filesize: 0
383 // CHECK: maxprot: rwx
384 // CHECK: initprot: rwx
389 // CHECK: ilocalsym: 0
390 // CHECK: nlocalsym: 8
391 // CHECK: iextdefsym: 8
392 // CHECK: nextdefsym: 5
393 // CHECK: iundefsym: 13
394 // CHECK: nundefsym: 11
397 // CHECK: modtaboff: 0
399 // CHECK: extrefsymoff: 0
400 // CHECK: nextrefsyms: 0
401 // CHECK: indirectsymoff: 0
402 // CHECK: nindirectsyms: 0
403 // CHECK: extreloff: 0
405 // CHECK: locreloff: 0