1 // RUN
: llvm-mc
-triple i386-apple-darwin9
%s
-filetype
=obj
-o
- | llvm-readobj
--file-headers
-S
--sd
-r
--symbols
--macho-segment
--macho-dysymtab
--macho-indirect-symbols | FileCheck
%s
3 // FIXME
: We don
't get the order right currently, the assembler first
4 // orders the symbols, then assigns addresses. :(
7 .lcomm sym_lcomm_C, 4, 4
8 .lcomm sym_lcomm_A, 4, 3
13 .lcomm sym_lcomm_C, 4, 4
18 .lcomm sym_lcomm_A, 4, 3
22 // CHECK: File: <stdin>
23 // CHECK: Format: Mach-O 32-bit i386
25 // CHECK: AddressSize: 32bit
26 // CHECK: MachHeader {
27 // CHECK: Magic: Magic (0xFEEDFACE)
28 // CHECK: CpuType: X86 (0x7)
29 // CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
30 // CHECK: FileType: Relocatable (0x1)
31 // CHECK: NumOfLoadCommands: 4
32 // CHECK: SizeOfLoadCommands: 312
33 // CHECK: Flags [ (0x0)
39 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
40 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
41 // CHECK: Address: 0x0
44 // CHECK: Alignment: 0
45 // CHECK: RelocationOffset: 0x0
46 // CHECK: RelocationCount: 0
47 // CHECK: Type: Regular (0x0)
48 // CHECK: Attributes [ (0x800000)
49 // CHECK: PureInstructions (0x800000)
51 // CHECK: Reserved1: 0x0
52 // CHECK: Reserved2: 0x0
53 // CHECK: SectionData (
58 // CHECK: Name: __bss (5F 5F 62 73 73 00 00 00 00 00 00 00 00 00 00 00)
59 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
60 // CHECK: Address: 0x0
63 // CHECK: Alignment: 4
64 // CHECK: RelocationOffset: 0x0
65 // CHECK: RelocationCount: 0
66 // CHECK: Type: ZeroFill (0x1)
67 // CHECK: Attributes [ (0x0)
69 // CHECK: Reserved1: 0x0
70 // CHECK: Reserved2: 0x0
73 // CHECK: Relocations [
77 // CHECK: Name: sym_lcomm_A (37)
78 // CHECK: Type: Section (0xE)
79 // CHECK: Section: __bss (0x2)
80 // CHECK: RefType: UndefinedNonLazy (0x0)
81 // CHECK: Flags [ (0x0)
86 // CHECK: Name: sym_lcomm_B (25)
87 // CHECK: Type: Section (0xE)
88 // CHECK: Section: __bss (0x2)
89 // CHECK: RefType: UndefinedNonLazy (0x0)
90 // CHECK: Flags [ (0x0)
95 // CHECK: Name: sym_lcomm_C (13)
97 // CHECK: Type: Section (0xE)
98 // CHECK: Section: __bss (0x2)
99 // CHECK: RefType: UndefinedNonLazy (0x0)
100 // CHECK: Flags [ (0x0)
105 // CHECK: Name: sym_lcomm_D (1)
107 // CHECK: Type: Section (0xE)
108 // CHECK: Section: __bss (0x2)
109 // CHECK: RefType: UndefinedNonLazy (0x0)
110 // CHECK: Flags [ (0x0)
115 // CHECK: Indirect Symbols {
121 // CHECK: Cmd: LC_SEGMENT
124 // CHECK: vmaddr: 0x0
125 // CHECK: vmsize: 0x10
126 // CHECK: fileoff: 340
127 // CHECK: filesize: 0
128 // CHECK: maxprot: rwx
129 // CHECK: initprot: rwx
134 // CHECK: ilocalsym: 0
135 // CHECK: nlocalsym: 2
136 // CHECK: iextdefsym: 2
137 // CHECK: nextdefsym: 2
138 // CHECK: iundefsym: 4
139 // CHECK: nundefsym: 0
142 // CHECK: modtaboff: 0
144 // CHECK: extrefsymoff: 0
145 // CHECK: nextrefsyms: 0
146 // CHECK: indirectsymoff: 0
147 // CHECK: nindirectsyms: 0
148 // CHECK: extreloff: 0
150 // CHECK: locreloff: 0