From 99124cc082d8b5d5a07bb80a4a37a0a88d6fade4 Mon Sep 17 00:00:00 2001 From: Puyan Lotfi Date: Fri, 7 Sep 2018 08:10:22 +0000 Subject: [llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu). Third Attempt: - Alignment issues resolved. - zlib::isAvailable() detected. - ArrayRef misuse fixed. 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: 341635 --- llvm/tools/llvm-objcopy/ObjcopyOpts.td | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/tools/llvm-objcopy/ObjcopyOpts.td') diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td index c34494736c3..e56dc52758c 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -17,6 +17,12 @@ def I : JoinedOrSeparate<[ "-" ], "I">, Alias; defm output_target : Eq<"output-target">, HelpText<"Format of the output file">, Values<"binary">; +def compress_debug_sections : Flag<["--", "-"], "compress-debug-sections">; +def compress_debug_sections_eq : Joined<["--", "-"], "compress-debug-sections=">, + MetaVarName<"[ zlib | zlib-gnu ]">, + HelpText<"Compress DWARF debug sections using " + "specified style. Supported styles: " + "'zlib-gnu' and 'zlib'">; def O : JoinedOrSeparate<["-"], "O">, Alias; defm split_dwo : Eq<"split-dwo">, -- cgit v1.2.3