llvm.org GIT mirror llvm / fb1b6fd
Add MachO-x86-64 tests. The object was already checked in, but was not being tested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179256 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
3 changed file(s) with 213 addition(s) and 87 deletion(s). Raw diff Collapse all Expand all
22 RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \
33 RUN: | FileCheck %s -check-prefix ELF
44 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \
5 RUN: | FileCheck %s -check-prefix MACHO
5 RUN: | FileCheck %s -check-prefix MACHO-I386
6 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \
7 RUN: | FileCheck %s -check-prefix MACHO-X86-64
68
79 COFF: Relocations [
810 COFF-NEXT: Section (1) .text {
2123 ELF-NEXT: }
2224 ELF-NEXT: ]
2325
24 MACHO: Relocations [
25 MACHO-NEXT: Section __text {
26 MACHO-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0
27 MACHO-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0
28 MACHO-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}}
29 MACHO-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}}
30 MACHO-NEXT: }
31 MACHO-NEXT: ]
26 MACHO-I386: Relocations [
27 MACHO-I386-NEXT: Section __text {
28 MACHO-I386-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0
29 MACHO-I386-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0
30 MACHO-I386-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}}
31 MACHO-I386-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}}
32 MACHO-I386-NEXT: }
33 MACHO-I386-NEXT: ]
34
35 MACHO-X86-64: Relocations [
36 MACHO-X86-64-NEXT: Section __text {
37 MACHO-X86-64-NEXT: 0xE X86_64_RELOC_BRANCH _SomeOtherFunction 0x0
38 MACHO-X86-64-NEXT: 0x9 X86_64_RELOC_BRANCH _puts 0x0
39 MACHO-X86-64-NEXT: 0x4 X86_64_RELOC_SIGNED L_.str 0x0
40 MACHO-X86-64-NEXT: }
41 MACHO-X86-64-NEXT:]
22 RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.elf-i386 \
33 RUN: | FileCheck %s -check-prefix ELF
44 RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-i386 \
5 RUN: | FileCheck %s -check-prefix MACHO
5 RUN: | FileCheck %s -check-prefix MACHO-I386
6 RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-x86-64 \
7 RUN: | FileCheck %s -check-prefix MACHO-X86-64
68
79 COFF: Sections [
810 COFF-NEXT: Section {
131133 ELF-NEXT: )
132134 ELF-NEXT: }
133135
134 MACHO: Sections [
135 MACHO-NEXT: Section {
136 MACHO-NEXT: Index: 0
137 MACHO-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
138 MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
139 MACHO-NEXT: Address: 0x0
140 MACHO-NEXT: Size: 0x22
141 MACHO-NEXT: Offset: 324
142 MACHO-NEXT: Alignment: 4
143 MACHO-NEXT: RelocationOffset: 0x174
144 MACHO-NEXT: RelocationCount: 4
145 MACHO-NEXT: Type: 0x0
146 MACHO-NEXT: Attributes [ (0x800004)
147 MACHO-NEXT: PureInstructions (0x800000)
148 MACHO-NEXT: SomeInstructions (0x4)
149 MACHO-NEXT: ]
150 MACHO-NEXT: Reserved1: 0x0
151 MACHO-NEXT: Reserved2: 0x0
152 MACHO-NEXT: Relocations [
153 MACHO-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0
154 MACHO-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0
155 MACHO-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}}
156 MACHO-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}}
157 MACHO-NEXT: ]
158 MACHO-NEXT: Symbols [
159 MACHO-NEXT: Symbol {
160 MACHO-NEXT: Name: _main (1)
161 MACHO-NEXT: Type: 0xF
162 MACHO-NEXT: Section: __text (0x1)
163 MACHO-NEXT: RefType: UndefinedNonLazy (0x0)
164 MACHO-NEXT: Flags [ (0x0)
165 MACHO-NEXT: ]
166 MACHO-NEXT: Value: 0x0
167 MACHO-NEXT: }
168 MACHO-NEXT: ]
169 MACHO-NEXT: SectionData (
170 MACHO-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......|
171 MACHO-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...|
172 MACHO-NEXT: 0020: 0CC3 |..|
173 MACHO-NEXT: )
174 MACHO-NEXT: }
136 MACHO-I386: Sections [
137 MACHO-I386-NEXT: Section {
138 MACHO-I386-NEXT: Index: 0
139 MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
140 MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
141 MACHO-I386-NEXT: Address: 0x0
142 MACHO-I386-NEXT: Size: 0x22
143 MACHO-I386-NEXT: Offset: 324
144 MACHO-I386-NEXT: Alignment: 4
145 MACHO-I386-NEXT: RelocationOffset: 0x174
146 MACHO-I386-NEXT: RelocationCount: 4
147 MACHO-I386-NEXT: Type: 0x0
148 MACHO-I386-NEXT: Attributes [ (0x800004)
149 MACHO-I386-NEXT: PureInstructions (0x800000)
150 MACHO-I386-NEXT: SomeInstructions (0x4)
151 MACHO-I386-NEXT: ]
152 MACHO-I386-NEXT: Reserved1: 0x0
153 MACHO-I386-NEXT: Reserved2: 0x0
154 MACHO-I386-NEXT: Relocations [
155 MACHO-I386-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0
156 MACHO-I386-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0
157 MACHO-I386-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}}
158 MACHO-I386-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}}
159 MACHO-I386-NEXT: ]
160 MACHO-I386-NEXT: Symbols [
161 MACHO-I386-NEXT: Symbol {
162 MACHO-I386-NEXT: Name: _main (1)
163 MACHO-I386-NEXT: Type: 0xF
164 MACHO-I386-NEXT: Section: __text (0x1)
165 MACHO-I386-NEXT: RefType: UndefinedNonLazy (0x0)
166 MACHO-I386-NEXT: Flags [ (0x0)
167 MACHO-I386-NEXT: ]
168 MACHO-I386-NEXT: Value: 0x0
169 MACHO-I386-NEXT: }
170 MACHO-I386-NEXT: ]
171 MACHO-I386-NEXT: SectionData (
172 MACHO-I386-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......|
173 MACHO-I386-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...|
174 MACHO-I386-NEXT: 0020: 0CC3 |..|
175 MACHO-I386-NEXT: )
176 MACHO-I386-NEXT: }
177
178
179 MACHO-X86-64: Sections [
180 MACHO-X86-64-NEXT: Section {
181 MACHO-X86-64-NEXT: Index: 0
182 MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
183 MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
184 MACHO-X86-64-NEXT: Address: 0x0
185 MACHO-X86-64-NEXT: Size: 0x16
186 MACHO-X86-64-NEXT: Offset: 368
187 MACHO-X86-64-NEXT: Alignment: 4
188 MACHO-X86-64-NEXT: RelocationOffset: 0x194
189 MACHO-X86-64-NEXT: RelocationCount: 3
190 MACHO-X86-64-NEXT: Type: 0x0
191 MACHO-X86-64-NEXT: Attributes [ (0x800004)
192 MACHO-X86-64-NEXT: PureInstructions (0x800000)
193 MACHO-X86-64-NEXT: SomeInstructions (0x4)
194 MACHO-X86-64-NEXT: ]
195 MACHO-X86-64-NEXT: Reserved1: 0x0
196 MACHO-X86-64-NEXT: Reserved2: 0x0
197 MACHO-X86-64-NEXT: Relocations [
198 MACHO-X86-64-NEXT: 0xE X86_64_RELOC_BRANCH _SomeOtherFunction 0x0
199 MACHO-X86-64-NEXT: 0x9 X86_64_RELOC_BRANCH _puts 0x0
200 MACHO-X86-64-NEXT: 0x4 X86_64_RELOC_SIGNED L_.str 0x0
201 MACHO-X86-64-NEXT: ]
202 MACHO-X86-64-NEXT: Symbols [
203 MACHO-X86-64-NEXT: Symbol {
204 MACHO-X86-64-NEXT: Name: _main (1)
205 MACHO-X86-64-NEXT: Type: 0xF
206 MACHO-X86-64-NEXT: Section: __text (0x1)
207 MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
208 MACHO-X86-64-NEXT: Flags [ (0x0)
209 MACHO-X86-64-NEXT: ]
210 MACHO-X86-64-NEXT: Value: 0x0
211 MACHO-X86-64-NEXT: }
212 MACHO-X86-64-NEXT: ]
213 MACHO-X86-64-NEXT: SectionData (
214 MACHO-X86-64-NEXT: 0000: 50488D3D 00000000 E8000000 00E80000 |PH.=............|
215 MACHO-X86-64-NEXT: 0010: 000031C0 5AC3 |..1.Z.|
216 MACHO-X86-64-NEXT: )
217 MACHO-X86-64-NEXT: }
218 MACHO-X86-64-NEXT: Section {
219 MACHO-X86-64-NEXT: Index: 1
220 MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
221 MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
222 MACHO-X86-64-NEXT: Address: 0x16
223 MACHO-X86-64-NEXT: Size: 0xD
224 MACHO-X86-64-NEXT: Offset: 390
225 MACHO-X86-64-NEXT: Alignment: 0
226 MACHO-X86-64-NEXT: RelocationOffset: 0x0
227 MACHO-X86-64-NEXT: RelocationCount: 0
228 MACHO-X86-64-NEXT: Type: ExtReloc (0x2)
229 MACHO-X86-64-NEXT: Attributes [ (0x0)
230 MACHO-X86-64-NEXT: ]
231 MACHO-X86-64-NEXT: Reserved1: 0x0
232 MACHO-X86-64-NEXT: Reserved2: 0x0
233 MACHO-X86-64-NEXT: Relocations [
234 MACHO-X86-64-NEXT: ]
235 MACHO-X86-64-NEXT: Symbols [
236 MACHO-X86-64-NEXT: Symbol {
237 MACHO-X86-64-NEXT: Name: L_.str (32)
238 MACHO-X86-64-NEXT: Type: Section (0xE)
239 MACHO-X86-64-NEXT: Section: __cstring (0x2)
240 MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0)
241 MACHO-X86-64-NEXT: Flags [ (0x0)
242 MACHO-X86-64-NEXT: ]
243 MACHO-X86-64-NEXT: Value: 0x16
244 MACHO-X86-64-NEXT: }
245 MACHO-X86-64-NEXT: ]
246 MACHO-X86-64-NEXT: SectionData (
247 MACHO-X86-64-NEXT: 0000: 48656C6C 6F20576F 726C640A 00 |Hello World..|
248 MACHO-X86-64-NEXT: )
249 MACHO-X86-64-NEXT: }
250 MACHO-X86-64-NEXT:]
22 RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-i386 \
33 RUN: | FileCheck %s -check-prefix ELF
44 RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-i386 \
5 RUN: | FileCheck %s -check-prefix MACHO
5 RUN: | FileCheck %s -check-prefix MACHO-I386
6 RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-x86-64 \
7 RUN: | FileCheck %s -check-prefix MACHO-X86-64
68
79 COFF: Sections [
810 COFF-NEXT: Section {
7577 ELF-NEXT: EntrySize: 0
7678 ELF-NEXT: }
7779
78 MACHO: Sections [
79 MACHO-NEXT: Section {
80 MACHO-NEXT: Index: 0
81 MACHO-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
82 MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
83 MACHO-NEXT: Address: 0x0
84 MACHO-NEXT: Size: 0x22
85 MACHO-NEXT: Offset: 324
86 MACHO-NEXT: Alignment: 4
87 MACHO-NEXT: RelocationOffset: 0x174
88 MACHO-NEXT: RelocationCount: 4
89 MACHO-NEXT: Type: 0x0
90 MACHO-NEXT: Attributes [ (0x800004)
91 MACHO-NEXT: PureInstructions (0x800000)
92 MACHO-NEXT: SomeInstructions (0x4)
93 MACHO-NEXT: ]
94 MACHO-NEXT: Reserved1: 0x0
95 MACHO-NEXT: Reserved2: 0x0
96 MACHO-NEXT: }
97 MACHO-NEXT: Section {
98 MACHO-NEXT: Index: 1
99 MACHO-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
100 MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
101 MACHO-NEXT: Address: 0x22
102 MACHO-NEXT: Size: 0xD
103 MACHO-NEXT: Offset: 358
104 MACHO-NEXT: Alignment: 0
105 MACHO-NEXT: RelocationOffset: 0x0
106 MACHO-NEXT: RelocationCount: 0
107 MACHO-NEXT: Type: ExtReloc (0x2)
108 MACHO-NEXT: Attributes [ (0x0)
109 MACHO-NEXT: ]
110 MACHO-NEXT: Reserved1: 0x0
111 MACHO-NEXT: Reserved2: 0x0
112 MACHO-NEXT: }
80 MACHO-I386: Sections [
81 MACHO-I386-NEXT: Section {
82 MACHO-I386-NEXT: Index: 0
83 MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
84 MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
85 MACHO-I386-NEXT: Address: 0x0
86 MACHO-I386-NEXT: Size: 0x22
87 MACHO-I386-NEXT: Offset: 324
88 MACHO-I386-NEXT: Alignment: 4
89 MACHO-I386-NEXT: RelocationOffset: 0x174
90 MACHO-I386-NEXT: RelocationCount: 4
91 MACHO-I386-NEXT: Type: 0x0
92 MACHO-I386-NEXT: Attributes [ (0x800004)
93 MACHO-I386-NEXT: PureInstructions (0x800000)
94 MACHO-I386-NEXT: SomeInstructions (0x4)
95 MACHO-I386-NEXT: ]
96 MACHO-I386-NEXT: Reserved1: 0x0
97 MACHO-I386-NEXT: Reserved2: 0x0
98 MACHO-I386-NEXT: }
99 MACHO-I386-NEXT: Section {
100 MACHO-I386-NEXT: Index: 1
101 MACHO-I386-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
102 MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
103 MACHO-I386-NEXT: Address: 0x22
104 MACHO-I386-NEXT: Size: 0xD
105 MACHO-I386-NEXT: Offset: 358
106 MACHO-I386-NEXT: Alignment: 0
107 MACHO-I386-NEXT: RelocationOffset: 0x0
108 MACHO-I386-NEXT: RelocationCount: 0
109 MACHO-I386-NEXT: Type: ExtReloc (0x2)
110 MACHO-I386-NEXT: Attributes [ (0x0)
111 MACHO-I386-NEXT: ]
112 MACHO-I386-NEXT: Reserved1: 0x0
113 MACHO-I386-NEXT: Reserved2: 0x0
114 MACHO-I386-NEXT: }
115
116
117 MACHO-X86-64: Sections [
118 MACHO-X86-64-NEXT: Section {
119 MACHO-X86-64-NEXT: Index: 0
120 MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
121 MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
122 MACHO-X86-64-NEXT: Address: 0x0
123 MACHO-X86-64-NEXT: Size: 0x16
124 MACHO-X86-64-NEXT: Offset: 368
125 MACHO-X86-64-NEXT: Alignment: 4
126 MACHO-X86-64-NEXT: RelocationOffset: 0x194
127 MACHO-X86-64-NEXT: RelocationCount: 3
128 MACHO-X86-64-NEXT: Type: 0x0
129 MACHO-X86-64-NEXT: Attributes [ (0x800004)
130 MACHO-X86-64-NEXT: PureInstructions (0x800000)
131 MACHO-X86-64-NEXT: SomeInstructions (0x4)
132 MACHO-X86-64-NEXT: ]
133 MACHO-X86-64-NEXT: Reserved1: 0x0
134 MACHO-X86-64-NEXT: Reserved2: 0x0
135 MACHO-X86-64-NEXT: }
136 MACHO-X86-64-NEXT: Section {
137 MACHO-X86-64-NEXT: Index: 1
138 MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
139 MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
140 MACHO-X86-64-NEXT: Address: 0x16
141 MACHO-X86-64-NEXT: Size: 0xD
142 MACHO-X86-64-NEXT: Offset: 390
143 MACHO-X86-64-NEXT: Alignment: 0
144 MACHO-X86-64-NEXT: RelocationOffset: 0x0
145 MACHO-X86-64-NEXT: RelocationCount: 0
146 MACHO-X86-64-NEXT: Type: ExtReloc (0x2)
147 MACHO-X86-64-NEXT: Attributes [ (0x0)
148 MACHO-X86-64-NEXT: ]
149 MACHO-X86-64-NEXT: Reserved1: 0x0
150 MACHO-X86-64-NEXT: Reserved2: 0x0
151 MACHO-X86-64-NEXT: }
152 MACHO-X86-64-NEXT:]