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 \ |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 ; CHECK: } | 378 ; CHECK: } |
379 | 379 |
380 | 380 |
381 ; CHECK: Relocations [ | 381 ; CHECK: Relocations [ |
382 ; CHECK: Section ({{[0-9]+}}) .rel.text { | 382 ; CHECK: Section ({{[0-9]+}}) .rel.text { |
383 ; CHECK: 0x4 R_386_32 .L$float$0 0x0 | 383 ; CHECK: 0x4 R_386_32 .L$float$0 0x0 |
384 ; CHECK: 0xC R_386_32 .L$float$1 0x0 | 384 ; CHECK: 0xC R_386_32 .L$float$1 0x0 |
385 ; CHECK: 0x24 R_386_32 .L$double$0 0x0 | 385 ; CHECK: 0x24 R_386_32 .L$double$0 0x0 |
386 ; CHECK: 0x2C R_386_32 .L$double$1 0x0 | 386 ; CHECK: 0x2C R_386_32 .L$double$1 0x0 |
387 ; CHECK: 0x34 R_386_32 .L$double$2 0x0 | 387 ; CHECK: 0x34 R_386_32 .L$double$2 0x0 |
388 ; The set of relocations between llvm-mc and integrated elf-writer | 388 ; CHECK: 0x{{.*}} R_386_PC32 memcpy |
389 ; are different. The integrated elf-writer does not yet handle | 389 ; CHECK: 0x{{.*}} R_386_PC32 memset |
390 ; external/undef functions like memcpy. Also, it does not resolve internal | |
391 ; function calls and instead writes out the relocation. However, there's | |
392 ; probably some function call so check for a PC32 relocation at least. | |
393 ; CHECK: 0x{{.*}} R_386_PC32 | |
394 ; CHECK: } | 390 ; CHECK: } |
395 ; CHECK: Section ({{[0-9]+}}) .rel.data { | 391 ; CHECK: Section ({{[0-9]+}}) .rel.data { |
396 ; The set of relocations between llvm-mc and the integrated elf-writer | 392 ; 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 | 393 ; are different. For local symbols, llvm-mc uses the section + offset within |
398 ; the section, while the integrated elf-writer refers the symbol itself. | 394 ; the section, while the integrated elf-writer refers the symbol itself. |
399 ; CHECK: 0x10 R_386_32 {{.*}} 0x0 | 395 ; CHECK: 0x10 R_386_32 {{.*}} 0x0 |
400 ; CHECK: 0x14 R_386_32 {{.*}} 0x0 | 396 ; CHECK: 0x14 R_386_32 {{.*}} 0x0 |
401 ; CHECK: 0x18 R_386_32 {{.*}} 0x0 | 397 ; CHECK: 0x18 R_386_32 {{.*}} 0x0 |
402 ; CHECK: } | 398 ; CHECK: } |
403 ; CHECK: Section ({{[0-9]+}}) .rel.rodata { | 399 ; CHECK: Section ({{[0-9]+}}) .rel.rodata { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 ; CHECK-NEXT: } | 606 ; CHECK-NEXT: } |
611 ; CHECK: Symbol { | 607 ; CHECK: Symbol { |
612 ; CHECK: Name: _start | 608 ; CHECK: Name: _start |
613 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} | 609 ; CHECK-NEXT: Value: 0x{{[1-9A-F][0-9A-F]*}} |
614 ; CHECK-NEXT: Size: 0 | 610 ; CHECK-NEXT: Size: 0 |
615 ; CHECK-NEXT: Binding: Global | 611 ; CHECK-NEXT: Binding: Global |
616 ; CHECK-NEXT: Type: Function | 612 ; CHECK-NEXT: Type: Function |
617 ; CHECK-NEXT: Other: 0 | 613 ; CHECK-NEXT: Other: 0 |
618 ; CHECK-NEXT: Section: .text | 614 ; CHECK-NEXT: Section: .text |
619 ; CHECK-NEXT: } | 615 ; CHECK-NEXT: } |
| 616 ; CHECK: Symbol { |
| 617 ; CHECK: Name: memcpy |
| 618 ; CHECK-NEXT: Value: 0x0 |
| 619 ; CHECK-NEXT: Size: 0 |
| 620 ; CHECK-NEXT: Binding: Global |
| 621 ; CHECK-NEXT: Type: None |
| 622 ; CHECK-NEXT: Other: 0 |
| 623 ; CHECK-NEXT: Section: Undefined |
| 624 ; CHECK-NEXT: } |
| 625 ; CHECK: Symbol { |
| 626 ; CHECK: Name: memset |
| 627 ; CHECK-NEXT: Value: 0x0 |
| 628 ; CHECK-NEXT: Size: 0 |
| 629 ; CHECK-NEXT: Binding: Global |
| 630 ; CHECK-NEXT: Type: None |
| 631 ; CHECK-NEXT: Other: 0 |
| 632 ; CHECK-NEXT: Section: Undefined |
| 633 ; CHECK-NEXT: } |
620 ; CHECK: ] | 634 ; CHECK: ] |
OLD | NEW |