OLD | NEW |
1 ; Tests that we generate an ELF container with fields that make sense, | 1 ; Tests that we generate an ELF container with fields that make sense, |
2 ; cross-validating against llvm-mc. | 2 ; cross-validating against llvm-mc. |
3 | 3 |
4 ; For the integrated ELF writer, we can't pipe the output because we need | 4 ; For the integrated ELF writer, we can't pipe the output because we need |
5 ; to seek backward and patch up the file headers. So, use a temporary file. | 5 ; to seek backward and patch up the file headers. So, use a temporary file. |
6 ; RUN: %p2i -i %s --args -O2 --verbose none -elf-writer -o %t \ | 6 ; RUN: %p2i -i %s --args -O2 --verbose none -elf-writer -o %t \ |
7 ; RUN: && llvm-readobj -file-headers -sections -section-data \ | 7 ; RUN: && llvm-readobj -file-headers -sections -section-data \ |
8 ; RUN: -relocations -symbols %t | FileCheck %s | 8 ; RUN: -relocations -symbols %t | FileCheck %s |
9 | 9 |
10 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 10 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
11 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj -o - \ | 11 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj -o - \ |
12 ; RUN: | llvm-readobj -file-headers -sections -section-data \ | 12 ; RUN: | llvm-readobj -file-headers -sections -section-data \ |
13 ; RUN: -relocations -symbols - | FileCheck %s | 13 ; RUN: -relocations -symbols - | FileCheck %s |
14 | 14 |
| 15 ; Add a run that shows relocations in code inline. |
| 16 ; RUN: %p2i -i %s --args -O2 --verbose none -elf-writer -o %t \ |
| 17 ; RUN: && llvm-objdump -d -r -x86-asm-syntax=intel %t \ |
| 18 ; RUN: | FileCheck --check-prefix=TEXT-RELOCS %s |
| 19 |
15 ; Use intrinsics to test external calls. | 20 ; Use intrinsics to test external calls. |
16 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) | 21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) |
17 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) | 22 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) |
18 | 23 |
19 ; Test some global data relocs (data, rodata, bss). | 24 ; Test some global data relocs (data, rodata, bss). |
20 @bytes = internal global [7 x i8] c"abcdefg", align 1 | 25 @bytes = internal global [7 x i8] c"ab\03\FF\F6fg", align 1 |
21 @const_bytes = internal constant [7 x i8] c"abcdefg", align 1 | 26 @bytes_const = internal constant [7 x i8] c"ab\03\FF\F6fg", align 1 |
22 | 27 |
23 @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32), align 4 | 28 @ptr = internal global i32 ptrtoint ([7 x i8]* @bytes to i32), align 16 |
24 @const_ptr = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32), align 4 | 29 @ptr_const = internal constant i32 ptrtoint ([7 x i8]* @bytes to i32), align 16 |
25 | 30 |
26 @ptr_to_func = internal global i32 ptrtoint (double ()* @returnDoubleConst to i3
2), align 4 | 31 @ptr_to_func = internal global i32 ptrtoint (double ()* @returnDoubleConst to i3
2), align 4 |
27 @const_ptr_to_func = internal constant i32 ptrtoint (double ()* @returnDoubleCon
st to i32), align 4 | 32 @ptr_to_func_const = internal constant i32 ptrtoint (double ()* @returnDoubleCon
st to i32), align 4 |
| 33 |
| 34 @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 128)
, align 4 |
| 35 @addend_ptr_const = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32),
i32 64), align 4 |
28 | 36 |
29 @short_zero = internal global [2 x i8] zeroinitializer, align 2 | 37 @short_zero = internal global [2 x i8] zeroinitializer, align 2 |
30 @double_zero = internal global [8 x i8] zeroinitializer, align 8 | 38 @double_zero = internal global [8 x i8] zeroinitializer, align 32 |
31 @const_short_zero = internal constant [2 x i8] zeroinitializer, align 2 | 39 @double_zero2 = internal global [8 x i8] zeroinitializer, align 8 |
32 @const_double_zero = internal constant [8 x i8] zeroinitializer, align 8 | 40 @short_zero_const = internal constant [2 x i8] zeroinitializer, align 2 |
33 | 41 @double_zero_const = internal constant [8 x i8] zeroinitializer, align 32 |
34 | 42 @double_zero_const2 = internal constant [8 x i8] zeroinitializer, align 8 |
35 @addend_ptr = internal global i32 add (i32 ptrtoint (i32* @ptr to i32), i32 128) | |
36 @const_addend_ptr = internal constant i32 add (i32 ptrtoint (i32* @ptr to i32),
i32 64) | |
37 | 43 |
38 ; Use float/double constants to test constant pools. | 44 ; Use float/double constants to test constant pools. |
39 define internal float @returnFloatConst() { | 45 define internal float @returnFloatConst() { |
40 entry: | 46 entry: |
41 %f = fadd float -0.0, 0x3FF3AE1400000000 | 47 %f = fadd float -0.0, 0x3FF3AE1400000000 |
42 ret float %f | 48 ret float %f |
43 } | 49 } |
| 50 ; TEXT-RELOCS-LABEL: returnFloatConst |
| 51 ; TEXT-RELOCS: movss |
| 52 ; TEXT-RELOCS-NEXT: R_386_32 .L$float$0 |
| 53 ; TEXT-RELOCS: addss |
| 54 ; TEXT-RELOCS-NEXT: R_386_32 .L$float$1 |
44 | 55 |
45 define internal double @returnDoubleConst() { | 56 define internal double @returnDoubleConst() { |
46 entry: | 57 entry: |
47 %d = fadd double 0x7FFFFFFFFFFFFFFFF, 0xFFF7FFFFFFFFFFFF | 58 %d = fadd double 0x7FFFFFFFFFFFFFFFF, 0xFFF7FFFFFFFFFFFF |
48 %d2 = fadd double %d, 0xFFF8000000000003 | 59 %d2 = fadd double %d, 0xFFF8000000000003 |
49 ret double %d2 | 60 ret double %d2 |
50 } | 61 } |
| 62 ; TEXT-RELOCS-LABEL: returnDoubleConst |
| 63 ; TEXT-RELOCS: movsd |
| 64 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$0 |
| 65 ; TEXT-RELOCS: addsd |
| 66 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$1 |
| 67 ; TEXT-RELOCS: addsd |
| 68 ; TEXT-RELOCS-NEXT: R_386_32 .L$double$2 |
51 | 69 |
52 ; Test intrinsics that call out to external functions. | 70 ; Test intrinsics that call out to external functions. |
53 define internal void @test_memcpy(i32 %iptr_dst, i32 %len) { | 71 define internal void @test_memcpy(i32 %iptr_dst, i32 %len) { |
54 entry: | 72 entry: |
55 %dst = inttoptr i32 %iptr_dst to i8* | 73 %dst = inttoptr i32 %iptr_dst to i8* |
56 %src = bitcast [7 x i8]* @bytes to i8* | 74 %src = bitcast [7 x i8]* @bytes to i8* |
57 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, | 75 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, |
58 i32 %len, i32 1, i1 false) | 76 i32 %len, i32 1, i1 false) |
59 ret void | 77 ret void |
60 } | 78 } |
| 79 ; TEXT-RELOCS-LABEL: test_memcpy |
| 80 ; TEXT-RELOCS: mov |
| 81 ; TEXT-RELOCS: R_386_32 bytes |
61 | 82 |
62 define internal void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { | 83 define internal void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { |
63 entry: | 84 entry: |
64 %val = trunc i32 %wide_val to i8 | 85 %val = trunc i32 %wide_val to i8 |
65 %dst = inttoptr i32 %iptr_dst to i8* | 86 %dst = inttoptr i32 %iptr_dst to i8* |
66 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, | 87 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, |
67 i32 %len, i32 1, i1 false) | 88 i32 %len, i32 1, i1 false) |
68 ret void | 89 ret void |
69 } | 90 } |
| 91 ; TEXT-RELOCS-LABEL: test_memset |
70 | 92 |
71 ; Test calling internal functions (may be able to do the fixup, | 93 ; Test calling internal functions (may be able to do the fixup, |
72 ; without emitting a relocation). | 94 ; without emitting a relocation). |
73 define internal float @test_call_internal() { | 95 define internal float @test_call_internal() { |
74 %f = call float @returnFloatConst() | 96 %f = call float @returnFloatConst() |
75 ret float %f | 97 ret float %f |
76 } | 98 } |
77 | 99 |
78 ; Test copying a function pointer, or a global data pointer. | 100 ; Test copying a function pointer, or a global data pointer. |
79 define internal i32 @test_ret_fp() { | 101 define internal i32 @test_ret_fp() { |
80 %r = ptrtoint float ()* @returnFloatConst to i32 | 102 %r = ptrtoint float ()* @returnFloatConst to i32 |
81 ret i32 %r | 103 ret i32 %r |
82 } | 104 } |
| 105 ; TEXT-RELOCS-LABEL: test_ret_fp |
| 106 ; TEXT-RELOCS-NEXT: mov |
| 107 ; TEXT-RELOCS-NEXT: R_386_32 returnFloatConst |
83 | 108 |
84 define internal i32 @test_ret_global_pointer() { | 109 define internal i32 @test_ret_global_pointer() { |
85 %r = ptrtoint [7 x i8]* @bytes to i32 | 110 %r = ptrtoint [7 x i8]* @bytes to i32 |
86 ret i32 %r | 111 ret i32 %r |
87 } | 112 } |
| 113 ; TEXT-RELOCS-LABEL: test_ret_global_pointer |
| 114 ; TEXT-RELOCS-NEXT: mov |
| 115 ; TEXT-RELOCS-NEXT: R_386_32 bytes |
88 | 116 |
89 ; Test defining a non-internal function. | 117 ; Test defining a non-internal function. |
90 define void @_start(i32) { | 118 define void @_start(i32) { |
91 %f = call float @returnFloatConst() | 119 %f = call float @returnFloatConst() |
92 %d = call double @returnDoubleConst() | 120 %d = call double @returnDoubleConst() |
93 call void @test_memcpy(i32 0, i32 99) | 121 call void @test_memcpy(i32 0, i32 99) |
94 call void @test_memset(i32 0, i32 0, i32 99) | 122 call void @test_memset(i32 0, i32 0, i32 99) |
95 %f2 = call float @test_call_internal() | 123 %f2 = call float @test_call_internal() |
96 %p1 = call i32 @test_ret_fp() | 124 %p1 = call i32 @test_ret_fp() |
97 %p2 = call i32 @test_ret_global_pointer() | 125 %p2 = call i32 @test_ret_global_pointer() |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ; CHECK: Flags [ (0x0) | 160 ; CHECK: Flags [ (0x0) |
133 ; CHECK: ] | 161 ; CHECK: ] |
134 ; CHECK: Address: 0x0 | 162 ; CHECK: Address: 0x0 |
135 ; CHECK: Offset: 0x0 | 163 ; CHECK: Offset: 0x0 |
136 ; CHECK: Size: 0 | 164 ; CHECK: Size: 0 |
137 ; CHECK: Link: 0 | 165 ; CHECK: Link: 0 |
138 ; CHECK: Info: 0 | 166 ; CHECK: Info: 0 |
139 ; CHECK: AddressAlignment: 0 | 167 ; CHECK: AddressAlignment: 0 |
140 ; CHECK: EntrySize: 0 | 168 ; CHECK: EntrySize: 0 |
141 ; CHECK: SectionData ( | 169 ; CHECK: SectionData ( |
142 ; CHECK-NEXT: ) | 170 ; CHECK: ) |
143 ; CHECK: } | 171 ; CHECK: } |
144 ; CHECK: Section { | 172 ; CHECK: Section { |
145 ; CHECK: Index: {{[1-9][0-9]*}} | 173 ; CHECK: Index: {{[1-9][0-9]*}} |
146 ; CHECK: Name: .text | 174 ; CHECK: Name: .text |
147 ; CHECK: Type: SHT_PROGBITS | 175 ; CHECK: Type: SHT_PROGBITS |
148 ; CHECK: Flags [ (0x6) | 176 ; CHECK: Flags [ (0x6) |
149 ; CHECK: SHF_ALLOC | 177 ; CHECK: SHF_ALLOC |
150 ; CHECK: SHF_EXECINSTR | 178 ; CHECK: SHF_EXECINSTR |
151 ; CHECK: ] | 179 ; CHECK: ] |
152 ; CHECK: Address: 0x0 | 180 ; CHECK: Address: 0x0 |
(...skipping 18 matching lines...) Expand all Loading... |
171 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} | 199 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
172 ; CHECK: Size: {{[1-9][0-9]*}} | 200 ; CHECK: Size: {{[1-9][0-9]*}} |
173 ; CHECK: Link: [[SYMTAB_INDEX:[1-9][0-9]*]] | 201 ; CHECK: Link: [[SYMTAB_INDEX:[1-9][0-9]*]] |
174 ; CHECK: Info: {{[1-9][0-9]*}} | 202 ; CHECK: Info: {{[1-9][0-9]*}} |
175 ; CHECK: AddressAlignment: 4 | 203 ; CHECK: AddressAlignment: 4 |
176 ; CHECK: EntrySize: 8 | 204 ; CHECK: EntrySize: 8 |
177 ; CHECK: SectionData ( | 205 ; CHECK: SectionData ( |
178 ; CHECK: ) | 206 ; CHECK: ) |
179 ; CHECK: } | 207 ; CHECK: } |
180 ; CHECK: Section { | 208 ; CHECK: Section { |
| 209 ; CHECK: Index: [[DATA_INDEX:[1-9][0-9]*]] |
| 210 ; CHECK: Name: .data |
| 211 ; CHECK: Type: SHT_PROGBITS |
| 212 ; CHECK: Flags [ (0x3) |
| 213 ; CHECK: SHF_ALLOC |
| 214 ; CHECK: SHF_WRITE |
| 215 ; CHECK: ] |
| 216 ; CHECK: Address: 0x0 |
| 217 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
| 218 ; CHECK: Size: 28 |
| 219 ; CHECK: Link: 0 |
| 220 ; CHECK: Info: 0 |
| 221 ; CHECK: AddressAlignment: 16 |
| 222 ; CHECK: EntrySize: 0 |
| 223 ; CHECK: SectionData ( |
| 224 ; CHECK: 0000: 616203FF F66667{{.*}} |ab...fg |
| 225 ; CHECK: ) |
| 226 ; CHECK: } |
| 227 ; CHECK: Section { |
| 228 ; CHECK: Index: {{[1-9][0-9]*}} |
| 229 ; CHECK: Name: .rel.data |
| 230 ; CHECK: Type: SHT_REL |
| 231 ; CHECK: Flags [ (0x0) |
| 232 ; CHECK: ] |
| 233 ; CHECK: Address: 0x0 |
| 234 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
| 235 ; CHECK: Size: 24 |
| 236 ; CHECK: Link: [[SYMTAB_INDEX]] |
| 237 ; CHECK: Info: [[DATA_INDEX]] |
| 238 ; CHECK: AddressAlignment: 4 |
| 239 ; CHECK: EntrySize: 8 |
| 240 ; CHECK: SectionData ( |
| 241 ; CHECK: ) |
| 242 ; CHECK: } |
| 243 ; CHECK: Section { |
| 244 ; CHECK: Index: {{[1-9][0-9]*}} |
| 245 ; CHECK: Name: .bss |
| 246 ; CHECK: Type: SHT_NOBITS |
| 247 ; CHECK: Flags [ (0x3) |
| 248 ; CHECK: SHF_ALLOC |
| 249 ; CHECK: SHF_WRITE |
| 250 ; CHECK: ] |
| 251 ; CHECK: Address: 0x0 |
| 252 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
| 253 ; CHECK: Size: 48 |
| 254 ; CHECK: Link: 0 |
| 255 ; CHECK: Info: 0 |
| 256 ; CHECK: AddressAlignment: 32 |
| 257 ; CHECK: EntrySize: 0 |
| 258 ; CHECK: SectionData ( |
| 259 ; CHECK: ) |
| 260 ; CHECK: } |
| 261 ; CHECK: Section { |
| 262 ; CHECK: Index: {{[1-9][0-9]*}} |
| 263 ; CHECK: Name: .rodata |
| 264 ; CHECK: Type: SHT_PROGBITS |
| 265 ; CHECK: Flags [ (0x2) |
| 266 ; CHECK: SHF_ALLOC |
| 267 ; CHECK: ] |
| 268 ; CHECK: Address: 0x0 |
| 269 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
| 270 ; CHECK: Size: 48 |
| 271 ; CHECK: Link: 0 |
| 272 ; CHECK: Info: 0 |
| 273 ; CHECK: AddressAlignment: 32 |
| 274 ; CHECK: EntrySize: 0 |
| 275 ; CHECK: SectionData ( |
| 276 ; CHECK: 0000: 616203FF F66667{{.*}} |ab...fg |
| 277 ; CHECK: ) |
| 278 ; CHECK: } |
| 279 ; CHECK: Section { |
| 280 ; CHECK: Index: {{[1-9][0-9]*}} |
| 281 ; CHECK: Name: .rel.rodata |
| 282 ; CHECK: Type: SHT_REL |
| 283 ; CHECK: Flags [ (0x0) |
| 284 ; CHECK: ] |
| 285 ; CHECK: Address: 0x0 |
| 286 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
| 287 ; CHECK: Size: {{[1-9][0-9]*}} |
| 288 ; CHECK: Link: [[SYMTAB_INDEX]] |
| 289 ; CHECK: Info: {{[1-9][0-9]*}} |
| 290 ; CHECK: AddressAlignment: 4 |
| 291 ; CHECK: EntrySize: 8 |
| 292 ; CHECK: SectionData ( |
| 293 ; CHECK: ) |
| 294 ; CHECK: } |
| 295 ; CHECK: Section { |
181 ; CHECK: Index: {{[1-9][0-9]*}} | 296 ; CHECK: Index: {{[1-9][0-9]*}} |
182 ; CHECK: Name: .rodata.cst4 | 297 ; CHECK: Name: .rodata.cst4 |
183 ; CHECK: Type: SHT_PROGBITS | 298 ; CHECK: Type: SHT_PROGBITS |
184 ; CHECK: Flags [ (0x12) | 299 ; CHECK: Flags [ (0x12) |
185 ; CHECK: SHF_ALLOC | 300 ; CHECK: SHF_ALLOC |
186 ; CHECK: SHF_MERGE | 301 ; CHECK: SHF_MERGE |
187 ; CHECK: ] | 302 ; CHECK: ] |
188 ; CHECK: Address: 0x0 | 303 ; CHECK: Address: 0x0 |
189 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} | 304 ; CHECK: Offset: 0x{{[1-9A-F][0-9A-F]*}} |
190 ; CHECK: Size: 8 | 305 ; CHECK: Size: 8 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 379 |
265 | 380 |
266 ; CHECK: Relocations [ | 381 ; CHECK: Relocations [ |
267 ; CHECK: Section ({{[0-9]+}}) .rel.text { | 382 ; CHECK: Section ({{[0-9]+}}) .rel.text { |
268 ; CHECK: 0x4 R_386_32 .L$float$0 0x0 | 383 ; CHECK: 0x4 R_386_32 .L$float$0 0x0 |
269 ; CHECK: 0xC R_386_32 .L$float$1 0x0 | 384 ; CHECK: 0xC R_386_32 .L$float$1 0x0 |
270 ; CHECK: 0x24 R_386_32 .L$double$0 0x0 | 385 ; CHECK: 0x24 R_386_32 .L$double$0 0x0 |
271 ; CHECK: 0x2C R_386_32 .L$double$1 0x0 | 386 ; CHECK: 0x2C R_386_32 .L$double$1 0x0 |
272 ; CHECK: 0x34 R_386_32 .L$double$2 0x0 | 387 ; CHECK: 0x34 R_386_32 .L$double$2 0x0 |
273 ; The set of relocations between llvm-mc and integrated elf-writer | 388 ; The set of relocations between llvm-mc and integrated elf-writer |
274 ; are different. The integrated elf-writer doesn't yet handle | 389 ; are different. The integrated elf-writer does not yet handle |
275 ; global data and external/undef functions like memcpy. | 390 ; external/undef functions like memcpy. Also, it does not resolve internal |
276 ; Also, it does not resolve internal function calls and instead | 391 ; function calls and instead writes out the relocation. However, there's |
277 ; writes out the relocation. However, there's probably some | 392 ; probably some function call so check for a PC32 relocation at least. |
278 ; function call so check for a PC32 relocation at least. | |
279 ; CHECK: 0x{{.*}} R_386_PC32 | 393 ; CHECK: 0x{{.*}} R_386_PC32 |
280 ; CHECK: } | 394 ; CHECK: } |
| 395 ; CHECK: Section ({{[0-9]+}}) .rel.data { |
| 396 ; The set of relocations between llvm-mc and the integrated elf-writer |
| 397 ; are different. For local symbols, llvm-mc uses the section + offset within |
| 398 ; the section, while the integrated elf-writer refers the symbol itself. |
| 399 ; CHECK: 0x10 R_386_32 {{.*}} 0x0 |
| 400 ; CHECK: 0x14 R_386_32 {{.*}} 0x0 |
| 401 ; CHECK: 0x18 R_386_32 {{.*}} 0x0 |
| 402 ; CHECK: } |
| 403 ; CHECK: Section ({{[0-9]+}}) .rel.rodata { |
| 404 ; CHECK: 0x10 R_386_32 {{.*}} 0x0 |
| 405 ; CHECK: 0x14 R_386_32 {{.*}} 0x0 |
| 406 ; CHECK: 0x18 R_386_32 {{.*}} 0x0 |
| 407 ; CHECK: } |
281 ; CHECK: ] | 408 ; CHECK: ] |
282 | 409 |
283 | 410 |
284 ; CHECK: Symbols [ | 411 ; CHECK: Symbols [ |
285 ; CHECK-NEXT: Symbol { | 412 ; CHECK-NEXT: Symbol { |
286 ; CHECK-NEXT: Name: (0) | 413 ; CHECK-NEXT: Name: (0) |
287 ; CHECK-NEXT: Value: 0x0 | 414 ; CHECK-NEXT: Value: 0x0 |
288 ; CHECK-NEXT: Size: 0 | 415 ; CHECK-NEXT: Size: 0 |
289 ; CHECK-NEXT: Binding: Local | 416 ; CHECK-NEXT: Binding: Local |
290 ; CHECK-NEXT: Type: None | 417 ; CHECK-NEXT: Type: None |
291 ; CHECK-NEXT: Other: 0 | 418 ; CHECK-NEXT: Other: 0 |
292 ; CHECK-NEXT: Section: Undefined (0x0) | 419 ; CHECK-NEXT: Section: Undefined (0x0) |
293 ; CHECK-NEXT: } | 420 ; CHECK-NEXT: } |
294 ; TODO: fill in the data symbols. | |
295 ; CHECK: Symbol { | 421 ; CHECK: Symbol { |
296 ; CHECK: Name: .L$double$0 | 422 ; CHECK: Name: .L$double$0 |
297 ; CHECK-NEXT: Value: 0x10 | 423 ; CHECK-NEXT: Value: 0x10 |
298 ; CHECK-NEXT: Size: 0 | 424 ; CHECK-NEXT: Size: 0 |
299 ; CHECK-NEXT: Binding: Local (0x0) | 425 ; CHECK-NEXT: Binding: Local (0x0) |
300 ; CHECK-NEXT: Type: None (0x0) | 426 ; CHECK-NEXT: Type: None (0x0) |
301 ; CHECK-NEXT: Other: 0 | 427 ; CHECK-NEXT: Other: 0 |
302 ; CHECK-NEXT: Section: .rodata.cst8 | 428 ; CHECK-NEXT: Section: .rodata.cst8 |
303 ; CHECK-NEXT: } | 429 ; CHECK-NEXT: } |
304 ; CHECK: Symbol { | 430 ; CHECK: Symbol { |
(...skipping 17 matching lines...) Expand all Loading... |
322 ; CHECK: Symbol { | 448 ; CHECK: Symbol { |
323 ; CHECK: Name: .L$float$1 | 449 ; CHECK: Name: .L$float$1 |
324 ; CHECK-NEXT: Value: 0x0 | 450 ; CHECK-NEXT: Value: 0x0 |
325 ; CHECK-NEXT: Size: 0 | 451 ; CHECK-NEXT: Size: 0 |
326 ; CHECK-NEXT: Binding: Local (0x0) | 452 ; CHECK-NEXT: Binding: Local (0x0) |
327 ; CHECK-NEXT: Type: None (0x0) | 453 ; CHECK-NEXT: Type: None (0x0) |
328 ; CHECK-NEXT: Other: 0 | 454 ; CHECK-NEXT: Other: 0 |
329 ; CHECK-NEXT: Section: .rodata.cst4 | 455 ; CHECK-NEXT: Section: .rodata.cst4 |
330 ; CHECK-NEXT: } | 456 ; CHECK-NEXT: } |
331 ; CHECK: Symbol { | 457 ; CHECK: Symbol { |
| 458 ; CHECK: Name: addend_ptr |
| 459 ; CHECK-NEXT: Value: 0x18 |
| 460 ; CHECK-NEXT: Size: 4 |
| 461 ; CHECK-NEXT: Binding: Local (0x0) |
| 462 ; CHECK-NEXT: Type: Object (0x1) |
| 463 ; CHECK-NEXT: Other: 0 |
| 464 ; CHECK-NEXT: Section: .data |
| 465 ; CHECK-NEXT: } |
| 466 ; CHECK: Symbol { |
| 467 ; CHECK: Name: addend_ptr_const |
| 468 ; CHECK-NEXT: Value: 0x18 |
| 469 ; CHECK-NEXT: Size: 4 |
| 470 ; CHECK-NEXT: Binding: Local (0x0) |
| 471 ; CHECK-NEXT: Type: Object (0x1) |
| 472 ; CHECK-NEXT: Other: 0 |
| 473 ; CHECK-NEXT: Section: .rodata |
| 474 ; CHECK-NEXT: } |
| 475 ; CHECK: Symbol { |
| 476 ; CHECK: Name: bytes |
| 477 ; CHECK-NEXT: Value: 0x0 |
| 478 ; CHECK-NEXT: Size: 7 |
| 479 ; CHECK-NEXT: Binding: Local (0x0) |
| 480 ; CHECK-NEXT: Type: Object (0x1) |
| 481 ; CHECK-NEXT: Other: 0 |
| 482 ; CHECK-NEXT: Section: .data |
| 483 ; CHECK-NEXT: } |
| 484 ; CHECK: Symbol { |
| 485 ; CHECK: Name: bytes_const |
| 486 ; CHECK-NEXT: Value: 0x0 |
| 487 ; CHECK-NEXT: Size: 7 |
| 488 ; CHECK-NEXT: Binding: Local (0x0) |
| 489 ; CHECK-NEXT: Type: Object (0x1) |
| 490 ; CHECK-NEXT: Other: 0 |
| 491 ; CHECK-NEXT: Section: .rodata |
| 492 ; CHECK-NEXT: } |
| 493 ; CHECK: Symbol { |
| 494 ; CHECK: Name: double_zero |
| 495 ; CHECK-NEXT: Value: 0x20 |
| 496 ; CHECK-NEXT: Size: 8 |
| 497 ; CHECK-NEXT: Binding: Local |
| 498 ; CHECK-NEXT: Type: Object |
| 499 ; CHECK-NEXT: Other: 0 |
| 500 ; CHECK-NEXT: Section: .bss |
| 501 ; CHECK-NEXT: } |
| 502 ; CHECK: Symbol { |
| 503 ; CHECK: Name: double_zero2 |
| 504 ; CHECK-NEXT: Value: 0x28 |
| 505 ; CHECK-NEXT: Size: 8 |
| 506 ; CHECK-NEXT: Binding: Local |
| 507 ; CHECK-NEXT: Type: Object |
| 508 ; CHECK-NEXT: Other: 0 |
| 509 ; CHECK-NEXT: Section: .bss |
| 510 ; CHECK-NEXT: } |
| 511 ; CHECK: Symbol { |
| 512 ; CHECK: Name: double_zero_const |
| 513 ; CHECK-NEXT: Value: 0x20 |
| 514 ; CHECK-NEXT: Size: 8 |
| 515 ; CHECK-NEXT: Binding: Local |
| 516 ; CHECK-NEXT: Type: Object |
| 517 ; CHECK-NEXT: Other: 0 |
| 518 ; CHECK-NEXT: Section: .rodata |
| 519 ; CHECK-NEXT: } |
| 520 ; CHECK: Symbol { |
| 521 ; CHECK: Name: double_zero_const2 |
| 522 ; CHECK-NEXT: Value: 0x28 |
| 523 ; CHECK-NEXT: Size: 8 |
| 524 ; CHECK-NEXT: Binding: Local |
| 525 ; CHECK-NEXT: Type: Object |
| 526 ; CHECK-NEXT: Other: 0 |
| 527 ; CHECK-NEXT: Section: .rodata |
| 528 ; CHECK-NEXT: } |
| 529 ; CHECK: Symbol { |
| 530 ; CHECK: Name: ptr |
| 531 ; CHECK-NEXT: Value: 0x10 |
| 532 ; CHECK-NEXT: Size: 4 |
| 533 ; CHECK-NEXT: Binding: Local |
| 534 ; CHECK-NEXT: Type: Object |
| 535 ; CHECK-NEXT: Other: 0 |
| 536 ; CHECK-NEXT: Section: .data |
| 537 ; CHECK-NEXT: } |
| 538 ; CHECK: Symbol { |
| 539 ; CHECK: Name: ptr_const |
| 540 ; CHECK-NEXT: Value: 0x10 |
| 541 ; CHECK-NEXT: Size: 4 |
| 542 ; CHECK-NEXT: Binding: Local |
| 543 ; CHECK-NEXT: Type: Object |
| 544 ; CHECK-NEXT: Other: 0 |
| 545 ; CHECK-NEXT: Section: .rodata |
| 546 ; CHECK-NEXT: } |
| 547 ; CHECK: Symbol { |
| 548 ; CHECK: Name: ptr_to_func |
| 549 ; CHECK-NEXT: Value: 0x14 |
| 550 ; CHECK-NEXT: Size: 4 |
| 551 ; CHECK-NEXT: Binding: Local |
| 552 ; CHECK-NEXT: Type: Object |
| 553 ; CHECK-NEXT: Other: 0 |
| 554 ; CHECK-NEXT: Section: .data |
| 555 ; CHECK-NEXT: } |
| 556 ; CHECK: Symbol { |
| 557 ; CHECK: Name: ptr_to_func_const |
| 558 ; CHECK-NEXT: Value: 0x14 |
| 559 ; CHECK-NEXT: Size: 4 |
| 560 ; CHECK-NEXT: Binding: Local |
| 561 ; CHECK-NEXT: Type: Object |
| 562 ; CHECK-NEXT: Other: 0 |
| 563 ; CHECK-NEXT: Section: .rodata |
| 564 ; CHECK-NEXT: } |
| 565 ; CHECK: Symbol { |
332 ; CHECK: Name: returnDoubleConst | 566 ; CHECK: Name: returnDoubleConst |
333 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} | 567 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} |
334 ; CHECK-NEXT: Size: 0 | 568 ; CHECK-NEXT: Size: 0 |
335 ; CHECK-NEXT: Binding: Local | 569 ; CHECK-NEXT: Binding: Local |
336 ; CHECK-NEXT: Type: None | 570 ; CHECK-NEXT: Type: None |
337 ; CHECK-NEXT: Other: 0 | 571 ; CHECK-NEXT: Other: 0 |
338 ; CHECK-NEXT: Section: .text | 572 ; CHECK-NEXT: Section: .text |
339 ; CHECK-NEXT: } | 573 ; CHECK-NEXT: } |
340 ; CHECK: Symbol { | 574 ; CHECK: Symbol { |
341 ; CHECK: Name: returnFloatConst | 575 ; CHECK: Name: returnFloatConst |
342 ; This happens to be the first function, so its offset is 0 within the text. | 576 ; This happens to be the first function, so its offset is 0 within the text. |
343 ; CHECK-NEXT: Value: 0x0 | 577 ; CHECK-NEXT: Value: 0x0 |
344 ; CHECK-NEXT: Size: 0 | 578 ; CHECK-NEXT: Size: 0 |
345 ; CHECK-NEXT: Binding: Local | 579 ; CHECK-NEXT: Binding: Local |
346 ; CHECK-NEXT: Type: None | 580 ; CHECK-NEXT: Type: None |
347 ; CHECK-NEXT: Other: 0 | 581 ; CHECK-NEXT: Other: 0 |
348 ; CHECK-NEXT: Section: .text | 582 ; CHECK-NEXT: Section: .text |
349 ; CHECK-NEXT: } | 583 ; CHECK-NEXT: } |
350 ; CHECK: Symbol { | 584 ; CHECK: Symbol { |
| 585 ; CHECK: Name: short_zero |
| 586 ; CHECK-NEXT: Value: 0x0 |
| 587 ; CHECK-NEXT: Size: 2 |
| 588 ; CHECK-NEXT: Binding: Local |
| 589 ; CHECK-NEXT: Type: Object |
| 590 ; CHECK-NEXT: Other: 0 |
| 591 ; CHECK-NEXT: Section: .bss |
| 592 ; CHECK-NEXT: } |
| 593 ; CHECK: Symbol { |
| 594 ; CHECK: Name: short_zero_const |
| 595 ; CHECK-NEXT: Value: 0x1C |
| 596 ; CHECK-NEXT: Size: 2 |
| 597 ; CHECK-NEXT: Binding: Local |
| 598 ; CHECK-NEXT: Type: Object |
| 599 ; CHECK-NEXT: Other: 0 |
| 600 ; CHECK-NEXT: Section: .rodata |
| 601 ; CHECK-NEXT: } |
| 602 ; CHECK: Symbol { |
351 ; CHECK: Name: test_memcpy | 603 ; CHECK: Name: test_memcpy |
352 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} | 604 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} |
353 ; CHECK-NEXT: Size: 0 | 605 ; CHECK-NEXT: Size: 0 |
354 ; CHECK-NEXT: Binding: Local | 606 ; CHECK-NEXT: Binding: Local |
355 ; CHECK-NEXT: Type: None | 607 ; CHECK-NEXT: Type: None |
356 ; CHECK-NEXT: Other: 0 | 608 ; CHECK-NEXT: Other: 0 |
357 ; CHECK-NEXT: Section: .text | 609 ; CHECK-NEXT: Section: .text |
358 ; CHECK-NEXT: } | 610 ; CHECK-NEXT: } |
359 ; CHECK: Symbol { | 611 ; CHECK: Symbol { |
360 ; CHECK: Name: _start | 612 ; CHECK: Name: _start |
361 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} | 613 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} |
362 ; CHECK-NEXT: Size: 0 | 614 ; CHECK-NEXT: Size: 0 |
363 ; CHECK-NEXT: Binding: Global | 615 ; CHECK-NEXT: Binding: Global |
364 ; CHECK-NEXT: Type: Function | 616 ; CHECK-NEXT: Type: Function |
365 ; CHECK-NEXT: Other: 0 | 617 ; CHECK-NEXT: Other: 0 |
366 ; CHECK-NEXT: Section: .text | 618 ; CHECK-NEXT: Section: .text |
367 ; CHECK-NEXT: } | 619 ; CHECK-NEXT: } |
368 ; CHECK: ] | 620 ; CHECK: ] |
OLD | NEW |