66 lines · plain
1# REQUIRES: zlib2## Test decompression for different sections.3 4# RUN: yaml2obj %s -o %t5# RUN: llvm-objcopy --decompress-debug-sections %t %t.de6# RUN: llvm-readelf -S %t.de | FileCheck %s7# RUN: llvm-objcopy --compress-sections '*nonalloc=none' --compress-sections .debugx=none %t %t.1.de8# RUN: cmp %t.de %t.1.de9 10# CHECK: Name Type Address Off Size ES Flg Lk Inf Al11# CHECK: .debug_alloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 AC 0 0 012# CHECK-NEXT: .debug_nonalloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 113# CHECK-NEXT: .debugx PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 114# CHECK-NEXT: nodebug PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 C 0 0 015 16# RUN: llvm-objcopy --compress-sections '.debug*=none' %t %t2.de17# RUN: llvm-readelf -S -x .debug_alloc -x .debug_nonalloc -x .debugx %t2.de | FileCheck %s --check-prefix=CHECK218 19# CHECK2: Name Type Address Off Size ES Flg Lk Inf Al20# CHECK2: .debug_alloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 A 0 0 121# CHECK2-NEXT: .debug_nonalloc PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 122# CHECK2-NEXT: .debugx PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 123# CHECK2-NEXT: nodebug PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 C 0 0 024 25# CHECK2: Hex dump of section '.debug_alloc':26# CHECK2-NEXT: 0x00000000 2a000000 00000000 2a000000 00000000 *.......*.......27# CHECK2-NEXT: 0x00000010 2a000000 00000000 2a000000 00000000 *.......*.......28# CHECK2-NEXT: 0x00000020 2a000000 00000000 2a000000 00000000 *.......*.......29# CHECK2-NEXT: 0x00000030 2a000000 00000000 2a000000 00000000 *.......*.......30# CHECK2-EMPTY:31# CHECK2: Hex dump of section '.debug_nonalloc':32# CHECK2-NEXT: 0x00000000 2a000000 00000000 2a000000 00000000 *.......*.......33# CHECK2-NEXT: 0x00000010 2a000000 00000000 2a000000 00000000 *.......*.......34# CHECK2-NEXT: 0x00000020 2a000000 00000000 2a000000 00000000 *.......*.......35# CHECK2-NEXT: 0x00000030 2a000000 00000000 2a000000 00000000 *.......*.......36# CHECK2-EMPTY:37# CHECK2-NEXT: Hex dump of section '.debugx':38# CHECK2-NEXT: 0x00000000 2a000000 00000000 2a000000 00000000 *.......*.......39# CHECK2-NEXT: 0x00000010 2a000000 00000000 2a000000 00000000 *.......*.......40# CHECK2-NEXT: 0x00000020 2a000000 00000000 2a000000 00000000 *.......*.......41# CHECK2-NEXT: 0x00000030 2a000000 00000000 2a000000 00000000 *.......*.......42 43--- !ELF44FileHeader:45 Class: ELFCLASS6446 Data: ELFDATA2LSB47 Type: ET_REL48 Machine: EM_X86_6449Sections:50 - Name: .debug_alloc51 Type: SHT_PROGBITS52 Flags: [ SHF_ALLOC, SHF_COMPRESSED ]53 Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f80015154 - Name: .debug_nonalloc55 Type: SHT_PROGBITS56 Flags: [ SHF_COMPRESSED ]57 Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f80015158 - Name: .debugx59 Type: SHT_PROGBITS60 Flags: [ SHF_COMPRESSED ]61 Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f80015162 - Name: nodebug63 Type: SHT_PROGBITS64 Flags: [ SHF_COMPRESSED ]65 Content: 010000000000000040000000000000000100000000000000789cd36280002d3269002f80015166