Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 1 | # RUN: yaml2obj %s > %t |
| 2 | # RUN: llvm-objcopy --strip-all %t %t2 |
| 3 | # RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s |
| 4 | |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame^] | 5 | # We run yaml2obj again rather than copy %t to avoid interfering |
| 6 | # with llvm-objcopy's test (which potentially could have corrupted/updated the binary). |
| 7 | |
| 8 | # RUN: yaml2obj %s > %t3 |
| 9 | # RUN: llvm-strip %t3 |
| 10 | # RUN: llvm-readobj -file-headers -sections %t3 | FileCheck %s |
| 11 | # RUN: cmp %t2 %t3 |
| 12 | |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 13 | !ELF |
| 14 | FileHeader: |
| 15 | Class: ELFCLASS64 |
| 16 | Data: ELFDATA2LSB |
| 17 | Type: ET_REL |
| 18 | Machine: EM_X86_64 |
| 19 | Sections: |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 20 | - Name: .bss |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 21 | Type: SHT_NOBITS |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 22 | Flags: [ SHF_ALLOC ] |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 23 | - Name: .text |
| 24 | Type: SHT_PROGBITS |
| 25 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 26 | - Name: .blarg |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 27 | Type: SHT_PROGBITS |
| 28 | Flags: [ ] |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 29 | - Name: .gnu.warning.foo |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 30 | Type: SHT_PROGBITS |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 31 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 32 | # CHECK: SectionHeaderCount: 5 |
Jake Ehrlich | fabddf1 | 2017-11-13 22:02:07 +0000 | [diff] [blame] | 33 | |
Jake Ehrlich | 6ad72d0 | 2017-11-27 18:56:01 +0000 | [diff] [blame] | 34 | # CHECK: Name: .bss |
| 35 | # CHECK: Name: .text |
| 36 | # CHECK: Name: .gnu.warning.foo |
| 37 | # CHECK: Name: .shstrtab |