diff options
| author | Puyan Lotfi <puyan@puyan.org> | 2018-09-03 22:25:56 +0000 |
|---|---|---|
| committer | Puyan Lotfi <puyan@puyan.org> | 2018-09-03 22:25:56 +0000 |
| commit | 5a40cd5b50e15ea5125904a1d389dadf8ac8647d (patch) | |
| tree | 07ed326b9b4b746a35468a62130680f73f0aced9 /llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test | |
| parent | 0945959869dfc7c8ef13c2eecc55c6d5f260c1d2 (diff) | |
| download | bcm5719-llvm-5a40cd5b50e15ea5125904a1d389dadf8ac8647d.tar.gz bcm5719-llvm-5a40cd5b50e15ea5125904a1d389dadf8ac8647d.zip | |
[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Usage:
llvm-objcopy --compress-debug-sections=zlib foo.o
llvm-objcopy --compress-debug-sections=zlib-gnu foo.o
In both cases the debug section contents is compressed with zlib. In the GNU
style case the header is the "ZLIB" magic string followed by the uint64 big-
endian decompressed size. In the non-GNU mode the header is the
Elf(32|64)_Chdr.
Decompression support is coming soon.
Differential Revision: https://reviews.llvm.org/D49678
llvm-svn: 341342
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test')
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test b/llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test new file mode 100644 index 00000000000..eb697522de2 --- /dev/null +++ b/llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test @@ -0,0 +1,49 @@ +# REQUIRES: zlib + +# RUN: yaml2obj %p/Inputs/compress-debug-sections.yaml -o %t.o +# RUN: llvm-objcopy --compress-debug-sections=zlib-gnu %t.o %t-compressed.o + +# RUN: llvm-objdump -s %t.o -section=.debug_foo | FileCheck %s +# RUN: llvm-objdump -s %t-compressed.o | FileCheck %s --check-prefix=CHECK-COMPRESSED +# RUN: llvm-readobj -relocations -s %t-compressed.o | FileCheck %s --check-prefix=CHECK-FLAGS + +# CHECK: .debug_foo: + +# CHECK-COMPRESSED: .zdebug_foo: +# CHECK-COMPRESSED: ZLIB +# CHECK-COMPRESSED: .notdebug_foo: + +# CHECK-FLAGS-NOT: Name: .debug_foo +# CHECK-FLAGS: Index: 1 +# CHECK-FLAGS-NEXT: Name: .zdebug_foo +# CHECK-FLAGS-NEXT: Type: SHT_PROGBITS +# CHECK-FLAGS-NEXT: Flags [ +# CHECK-FLAGS-NEXT: ] +# CHECK-FLAGS-NEXT: Address: +# CHECK-FLAGS-NEXT: Offset: +# CHECK-FLAGS-NEXT: Size: 23 + +# CHECK-FLAGS: Name: .notdebug_foo +# CHECK-FLAGS-NEXT: Type: SHT_PROGBITS +# CHECK-FLAGS-NEXT: Flags [ +# CHECK-FLAGS-NEXT: ] +# CHECK-FLAGS-NEXT: Address: +# CHECK-FLAGS-NEXT: Offset: +# CHECK-FLAGS-NEXT: Size: 8 + +# CHECK-FLAGS: Name: .rela.debug_foo +# CHECK-FLAGS-NEXT: Type: SHT_RELA +# CHECK-FLAGS-NEXT: Flags [ +# CHECK-FLAGS-NEXT: ] +# CHECK-FLAGS-NEXT: Address: +# CHECK-FLAGS-NEXT: Offset: +# CHECK-FLAGS-NEXT: Size: +# CHECK-FLAGS-NEXT: Link: +# CHECK-FLAGS-NEXT: Info: 1 + +# CHECK-FLAGS: Relocations [ +# CHECK-FLAGS-NEXT: .rela.debug_foo { +# CHECK-FLAGS-NEXT: 0x1 R_X86_64_32 - 0x0 +# CHECK-FLAGS-NEXT: } +# CHECK-FLAGS-NEXT: ] + |

