63 lines · plain
1# RUN: yaml2obj --docnum=1 %s -o %t2# RUN: llvm-objcopy --strip-non-alloc %t %t.out3# RUN: llvm-readobj --file-headers --sections %t.out | FileCheck %s4 5# CHECK: SectionHeaderCount: 56# CHECK: Name: non_alloc_in_segment7# CHECK: Name: .bss8# CHECK: Name: .text9# CHECK: Name: .shstrtab10 11--- !ELF12FileHeader:13 Class: ELFCLASS6414 Data: ELFDATA2LSB15 Type: ET_REL16 Machine: EM_X86_6417Sections:18 - Name: non_alloc_in_segment19 Type: SHT_PROGBITS20 Flags: [ ]21 Size: 422 - Name: .bss23 Type: SHT_NOBITS24 Flags: [ SHF_ALLOC ]25 - Name: .text26 Type: SHT_PROGBITS27 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]28ProgramHeaders:29 # Use an arbitrary segment type to show that the segment type is unimportant.30 - Type: 0x6123456731 FirstSec: non_alloc_in_segment32 LastSec: non_alloc_in_segment33 34# RUN: yaml2obj --docnum=2 %s -o %t235# RUN: llvm-objcopy --strip-non-alloc %t2 %t2.out36# RUN: llvm-readobj --file-headers --sections %t2.out | FileCheck --check-prefix=CHECK2 %s37 38# CHECK2: SectionHeaderCount: 339# CHECK2: Name: .text40# CHECK2: Name: .shstrtab41 42--- !ELF43FileHeader:44 Class: ELFCLASS6445 Data: ELFDATA2LSB46 Type: ET_REL47 Machine: EM_X86_6448Sections:49 - Name: .text50 Type: SHT_PROGBITS51 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]52## empty_trailing_non_alloc is considered included by the segment,53## so it will be retained.54 - Name: empty_trailing_non_alloc55 Type: SHT_PROGBITS56 - Name: trailing_non_alloc57 Type: SHT_PROGBITS58 Content: 0059ProgramHeaders:60 - Type: 0x6123456761 FirstSec: .text62 LastSec: .text63