Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 1 | # RUN: yaml2obj %s > %t |
| 2 | # RUN: llvm-objcopy --strip-non-alloc %t %t2 |
| 3 | # RUN: llvm-readobj --file-headers --sections %t2 | FileCheck %s |
| 4 | |
| 5 | !ELF |
| 6 | FileHeader: |
| 7 | Class: ELFCLASS64 |
| 8 | Data: ELFDATA2LSB |
| 9 | Type: ET_REL |
| 10 | Machine: EM_X86_64 |
| 11 | Sections: |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 12 | - Name: non_alloc_in_segment |
| 13 | Type: SHT_PROGBITS |
| 14 | Flags: [ ] |
| 15 | Size: 4 |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 16 | - Name: .bss |
| 17 | Type: SHT_NOBITS |
| 18 | Flags: [ SHF_ALLOC ] |
| 19 | - Name: .text |
| 20 | Type: SHT_PROGBITS |
| 21 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 22 | - Name: .blarg |
| 23 | Type: SHT_PROGBITS |
| 24 | Flags: [ ] |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 25 | ProgramHeaders: |
| 26 | # Use an arbitrary segment type to show that the segment type is unimportant. |
| 27 | - Type: 0x61234567 |
| 28 | Sections: |
| 29 | - Section: non_alloc_in_segment |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 30 | |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 31 | # CHECK: SectionHeaderCount: 5 |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 32 | |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 33 | # CHECK: Name: non_alloc_in_segment |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 34 | # CHECK: Name: .bss |
| 35 | # CHECK: Name: .text |
| 36 | # CHECK: Name: .shstrtab |