39 lines · plain
1## Disallow (de)compression for sections within a segment as they are2## effectively immutable.3# RUN: rm -rf %t && mkdir %t && cd %t4# RUN: yaml2obj %s -o a5# RUN: not llvm-objcopy a /dev/null --compress-sections .text=zlib 2>&1 | FileCheck %s --implicit-check-not=error:6 7# CHECK: error: 'a': section '.text' within a segment cannot be (de)compressed8 9# RUN: not llvm-objcopy a /dev/null --compress-sections foo=none 2>&1 | FileCheck %s --check-prefix=CHECK2 --implicit-check-not=error:10 11# CHECK2: error: 'a': section 'foo' within a segment cannot be (de)compressed12 13## There is an error even if 'foo' is already compressed with zlib.14# RUN: not llvm-objcopy a /dev/null --compress-sections foo=zlib 2>&1 | FileCheck %s --check-prefix=CHECK3 --implicit-check-not=error:15 16# CHECK3: error: 'a': section 'foo' within a segment cannot be (de)compressed17 18--- !ELF19FileHeader:20 Class: ELFCLASS6421 Data: ELFDATA2LSB22 Type: ET_EXEC23 Machine: EM_X86_6424ProgramHeaders:25 - Type: PT_LOAD26 FirstSec: .text27 LastSec: foo28 Align: 0x100029 Offset: 0x100030Sections:31 - Name: .text32 Type: SHT_PROGBITS33 Offset: 0x100034 Content: C335 - Name: foo36 Type: SHT_PROGBITS37 Flags: [ SHF_COMPRESSED ]38 Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f80015139