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
3 // FIXME: We are missing a lot of diagnostics on this kind of stuff which the
7 .indirect_symbol sym_lsp_B
11 .indirect_symbol sym_lsp_A
15 .indirect_symbol sym_lsp_C
18 // FIXME: Enable this test once missing llvm-mc support is in place.
20 .indirect_symbol sym_lsp_D
24 .indirect_symbol sym_lsp_E
27 // FIXME: Enable this test once missing llvm-mc support is in place.
30 .indirect_symbol sym_lsp_F
36 .indirect_symbol sym_lsp_G
39 .non_lazy_symbol_pointer
40 .indirect_symbol sym_nlp_B
44 .indirect_symbol sym_nlp_A
48 .indirect_symbol sym_nlp_C
51 // FIXME: Enable this test once missing llvm-mc support is in place.
53 .indirect_symbol sym_nlp_D
57 .indirect_symbol sym_nlp_E
60 // FIXME: Enable this test once missing llvm-mc support is in place.
63 .indirect_symbol sym_nlp_F
69 .indirect_symbol sym_nlp_G
72 // CHECK: File: <stdin>
73 // CHECK: Format: Mach-O 32-bit i386
75 // CHECK: AddressSize: 32bit
76 // CHECK: MachHeader {
77 // CHECK: Magic: Magic (0xFEEDFACE)
78 // CHECK: CpuType: X86 (0x7)
79 // CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
80 // CHECK: FileType: Relocatable (0x1)
81 // CHECK: NumOfLoadCommands: 4
82 // CHECK: SizeOfLoadCommands: 380
83 // CHECK: Flags [ (0x0)
89 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
90 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
91 // CHECK: Address: 0x0
94 // CHECK: Alignment: 0
95 // CHECK: RelocationOffset: 0x0
96 // CHECK: RelocationCount: 0
98 // CHECK: Attributes [ (0x800000)
99 // CHECK: PureInstructions (0x800000)
101 // CHECK: Reserved1: 0x0
102 // CHECK: Reserved2: 0x0
106 // CHECK: Name: __la_symbol_ptr (5F 5F 6C 61 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
107 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
108 // CHECK: Address: 0x0
110 // CHECK: Offset: 408
111 // CHECK: Alignment: 2
112 // CHECK: RelocationOffset: 0x0
113 // CHECK: RelocationCount: 0
115 // CHECK: Attributes [ (0x0)
117 // CHECK: Reserved1: 0x0
118 // CHECK: Reserved2: 0x0
122 // CHECK: Name: __nl_symbol_ptr (5F 5F 6E 6C 5F 73 79 6D 62 6F 6C 5F 70 74 72 00)
123 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
124 // CHECK: Address: 0x14
126 // CHECK: Offset: 428
127 // CHECK: Alignment: 2
128 // CHECK: RelocationOffset: 0x0
129 // CHECK: RelocationCount: 0
131 // CHECK: Attributes [ (0x0)
133 // CHECK: Reserved1: 0x5
134 // CHECK: Reserved2: 0x0
137 // CHECK: Relocations [
141 // CHECK: Name: sym_lsp_C (41)
142 // CHECK: Type: Section (0xE)
143 // CHECK: Section: __la_symbol_ptr (0x2)
144 // CHECK: RefType: UndefinedNonLazy (0x0)
145 // CHECK: Flags [ (0x0)
150 // CHECK: Name: sym_nlp_C (51)
151 // CHECK: Type: Section (0xE)
152 // CHECK: Section: __nl_symbol_ptr (0x3)
153 // CHECK: RefType: UndefinedNonLazy (0x0)
154 // CHECK: Flags [ (0x0)
156 // CHECK: Value: 0x1C
159 // CHECK: Name: sym_lsp_G (1)
161 // CHECK: Type: Section (0xE)
162 // CHECK: Section: __la_symbol_ptr (0x2)
163 // CHECK: RefType: UndefinedNonLazy (0x0)
164 // CHECK: Flags [ (0x0)
166 // CHECK: Value: 0x10
169 // CHECK: Name: sym_nlp_G (11)
171 // CHECK: Type: Section (0xE)
172 // CHECK: Section: __nl_symbol_ptr (0x3)
173 // CHECK: RefType: UndefinedNonLazy (0x0)
174 // CHECK: Flags [ (0x0)
176 // CHECK: Value: 0x24
179 // CHECK: Name: sym_lsp_A (81)
181 // CHECK: Type: Undef (0x0)
182 // CHECK: Section: (0x0)
183 // CHECK: RefType: UndefinedNonLazy (0x0)
184 // CHECK: Flags [ (0x0)
189 // CHECK: Name: sym_lsp_B (61)
191 // CHECK: Type: Undef (0x0)
192 // CHECK: Section: (0x0)
193 // CHECK: RefType: ReferenceFlagUndefinedLazy (0x1)
194 // CHECK: Flags [ (0x0)
199 // CHECK: Name: sym_lsp_E (21)
201 // CHECK: Type: Undef (0x0)
202 // CHECK: Section: (0x0)
203 // CHECK: RefType: ReferenceFlagUndefinedLazy (0x1)
204 // CHECK: Flags [ (0x0)
209 // CHECK: Name: sym_nlp_A (91)
211 // CHECK: Type: Undef (0x0)
212 // CHECK: Section: (0x0)
213 // CHECK: RefType: UndefinedNonLazy (0x0)
214 // CHECK: Flags [ (0x0)
219 // CHECK: Name: sym_nlp_B (71)
221 // CHECK: Type: Undef (0x0)
222 // CHECK: Section: (0x0)
223 // CHECK: RefType: UndefinedNonLazy (0x0)
224 // CHECK: Flags [ (0x0)
229 // CHECK: Name: sym_nlp_E (31)
231 // CHECK: Type: Undef (0x0)
232 // CHECK: Section: (0x0)
233 // CHECK: RefType: UndefinedNonLazy (0x0)
234 // CHECK: Flags [ (0x0)
239 // CHECK: Indirect Symbols {
243 // CHECK: Entry Index: 0
244 // CHECK: Symbol Index: 0x5
247 // CHECK: Entry Index: 1
248 // CHECK: Symbol Index: 0x4
251 // CHECK: Entry Index: 2
252 // CHECK: Symbol Index: 0x0
255 // CHECK: Entry Index: 3
256 // CHECK: Symbol Index: 0x6
259 // CHECK: Entry Index: 4
260 // CHECK: Symbol Index: 0x2
263 // CHECK: Entry Index: 5
264 // CHECK: Symbol Index: 0x8
267 // CHECK: Entry Index: 6
268 // CHECK: Symbol Index: 0x7
271 // CHECK: Entry Index: 7
272 // CHECK: Symbol Index: 0x80000000
275 // CHECK: Entry Index: 8
276 // CHECK: Symbol Index: 0x9
279 // CHECK: Entry Index: 9
280 // CHECK: Symbol Index: 0x3
285 // CHECK: Cmd: LC_SEGMENT
288 // CHECK: vmaddr: 0x0
289 // CHECK: vmsize: 0x28
290 // CHECK: fileoff: 408
291 // CHECK: filesize: 40
292 // CHECK: maxprot: rwx
293 // CHECK: initprot: rwx
298 // CHECK: ilocalsym: 0
299 // CHECK: nlocalsym: 2
300 // CHECK: iextdefsym: 2
301 // CHECK: nextdefsym: 2
302 // CHECK: iundefsym: 4
303 // CHECK: nundefsym: 6
306 // CHECK: modtaboff: 0
308 // CHECK: extrefsymoff: 0
309 // CHECK: nextrefsyms: 0
310 // CHECK: indirectsymoff: 448
311 // CHECK: nindirectsyms: 10
312 // CHECK: extreloff: 0
314 // CHECK: locreloff: 0