blob: 5f902ebac4f60f0388830e83d576d58374479db2 [file] [log] [blame]
Davide Italianoddedd722015-09-10 01:50:00 +00001// 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
Daniel Dunbar42a39d02009-08-28 05:49:21 +00002
3 // Note, this test intentionally mismatches Darwin 'as', which loses the
4 // following global marker.
5 //
6 // FIXME: We should probably warn about our interpretation of this.
7 .globl sym_lcomm_ext_A
8 .lcomm sym_lcomm_ext_A, 4
9 .lcomm sym_lcomm_ext_B, 4
10 .globl sym_lcomm_ext_B
11
12 .globl sym_zfill_ext_A
13 .zerofill __DATA, __bss, sym_zfill_ext_A, 4
14 .zerofill __DATA, __bss, sym_zfill_ext_B, 4
15 .globl sym_zfill_ext_B
16
Davide Italianoddedd722015-09-10 01:50:00 +000017// CHECK: File: <stdin>
18// CHECK: Format: Mach-O 32-bit i386
19// CHECK: Arch: i386
20// CHECK: AddressSize: 32bit
21// CHECK: MachHeader {
22// CHECK: Magic: Magic (0xFEEDFACE)
23// CHECK: CpuType: X86 (0x7)
24// CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
25// CHECK: FileType: Relocatable (0x1)
26// CHECK: NumOfLoadCommands: 4
27// CHECK: SizeOfLoadCommands: 312
28// CHECK: Flags [ (0x0)
29// CHECK: ]
30// CHECK: }
31// CHECK: Sections [
32// CHECK: Section {
33// CHECK: Index: 0
34// CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
35// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
36// CHECK: Address: 0x0
37// CHECK: Size: 0x0
38// CHECK: Offset: 340
39// CHECK: Alignment: 0
40// CHECK: RelocationOffset: 0x0
41// CHECK: RelocationCount: 0
42// CHECK: Type: 0x0
43// CHECK: Attributes [ (0x800000)
44// CHECK: PureInstructions (0x800000)
45// CHECK: ]
46// CHECK: Reserved1: 0x0
47// CHECK: Reserved2: 0x0
48// CHECK: }
49// CHECK: Section {
50// CHECK: Index: 1
51// CHECK: Name: __bss (5F 5F 62 73 73 00 00 00 00 00 00 00 00 00 00 00)
52// CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
53// CHECK: Address: 0x0
54// CHECK: Size: 0x10
55// CHECK: Offset: 0
56// CHECK: Alignment: 0
57// CHECK: RelocationOffset: 0x0
58// CHECK: RelocationCount: 0
59// CHECK: Type: LocReloc (0x1)
60// CHECK: Attributes [ (0x0)
61// CHECK: ]
62// CHECK: Reserved1: 0x0
63// CHECK: Reserved2: 0x0
64// CHECK: }
65// CHECK: ]
66// CHECK: Relocations [
67// CHECK: ]
68// CHECK: Symbols [
69// CHECK: Symbol {
70// CHECK: Name: sym_lcomm_ext_A (33)
71// CHECK: Extern
72// CHECK: Type: Section (0xE)
73// CHECK: Section: __bss (0x2)
74// CHECK: RefType: UndefinedNonLazy (0x0)
75// CHECK: Flags [ (0x0)
76// CHECK: ]
77// CHECK: Value: 0x0
78// CHECK: }
79// CHECK: Symbol {
80// CHECK: Name: sym_lcomm_ext_B (1)
81// CHECK: Extern
82// CHECK: Type: Section (0xE)
83// CHECK: Section: __bss (0x2)
84// CHECK: RefType: UndefinedNonLazy (0x0)
85// CHECK: Flags [ (0x0)
86// CHECK: ]
87// CHECK: Value: 0x4
88// CHECK: }
89// CHECK: Symbol {
90// CHECK: Name: sym_zfill_ext_A (49)
91// CHECK: Extern
92// CHECK: Type: Section (0xE)
93// CHECK: Section: __bss (0x2)
94// CHECK: RefType: UndefinedNonLazy (0x0)
95// CHECK: Flags [ (0x0)
96// CHECK: ]
97// CHECK: Value: 0x8
98// CHECK: }
99// CHECK: Symbol {
100// CHECK: Name: sym_zfill_ext_B (17)
101// CHECK: Extern
102// CHECK: Type: Section (0xE)
103// CHECK: Section: __bss (0x2)
104// CHECK: RefType: UndefinedNonLazy (0x0)
105// CHECK: Flags [ (0x0)
106// CHECK: ]
107// CHECK: Value: 0xC
108// CHECK: }
109// CHECK: ]
110// CHECK: Indirect Symbols {
111// CHECK: Number: 0
112// CHECK: Symbols [
113// CHECK: ]
114// CHECK: }
115// CHECK: Segment {
116// CHECK: Cmd: LC_SEGMENT
117// CHECK: Name:
118// CHECK: Size: 192
119// CHECK: vmaddr: 0x0
120// CHECK: vmsize: 0x10
121// CHECK: fileoff: 340
122// CHECK: filesize: 0
123// CHECK: maxprot: rwx
124// CHECK: initprot: rwx
125// CHECK: nsects: 2
126// CHECK: flags: 0x0
127// CHECK: }
128// CHECK: Dysymtab {
129// CHECK: ilocalsym: 0
130// CHECK: nlocalsym: 0
131// CHECK: iextdefsym: 0
132// CHECK: nextdefsym: 4
133// CHECK: iundefsym: 4
134// CHECK: nundefsym: 0
135// CHECK: tocoff: 0
136// CHECK: ntoc: 0
137// CHECK: modtaboff: 0
138// CHECK: nmodtab: 0
139// CHECK: extrefsymoff: 0
140// CHECK: nextrefsyms: 0
141// CHECK: indirectsymoff: 0
142// CHECK: nindirectsyms: 0
143// CHECK: extreloff: 0
144// CHECK: nextrel: 0
145// CHECK: locreloff: 0
146// CHECK: nlocrel: 0
147// CHECK: }