blob: e4bf4e5e654a5ba18ddc8d1ef6e506640d1c5eb5 [file] [log] [blame]
Jake Ehrlichfabddf12017-11-13 22:02:07 +00001# RUN: yaml2obj %s > %t
2# RUN: llvm-objcopy --strip-all %t %t2
3# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
4
Alexander Shaposhnikovcca69982018-05-07 19:32:09 +00005# 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 Ehrlichfabddf12017-11-13 22:02:07 +000013!ELF
14FileHeader:
15 Class: ELFCLASS64
16 Data: ELFDATA2LSB
17 Type: ET_REL
18 Machine: EM_X86_64
19Sections:
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000020 - Name: .bss
Jake Ehrlichfabddf12017-11-13 22:02:07 +000021 Type: SHT_NOBITS
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000022 Flags: [ SHF_ALLOC ]
Jake Ehrlichfabddf12017-11-13 22:02:07 +000023 - Name: .text
24 Type: SHT_PROGBITS
25 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000026 - Name: .blarg
Jake Ehrlichfabddf12017-11-13 22:02:07 +000027 Type: SHT_PROGBITS
28 Flags: [ ]
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000029 - Name: .gnu.warning.foo
Jake Ehrlichfabddf12017-11-13 22:02:07 +000030 Type: SHT_PROGBITS
Jake Ehrlichfabddf12017-11-13 22:02:07 +000031
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000032# CHECK: SectionHeaderCount: 5
Jake Ehrlichfabddf12017-11-13 22:02:07 +000033
Jake Ehrlich6ad72d02017-11-27 18:56:01 +000034# CHECK: Name: .bss
35# CHECK: Name: .text
36# CHECK: Name: .gnu.warning.foo
37# CHECK: Name: .shstrtab