[llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
authorPuyan Lotfi <puyan@puyan.org>
Fri, 7 Sep 2018 08:10:22 +0000 (08:10 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Fri, 7 Sep 2018 08:10:22 +0000 (08:10 +0000)
commit99124cc082d8b5d5a07bb80a4a37a0a88d6fade4
tree5e4b9d4de8ab7ac93e3eaa1f6215b2e2d3e7a75d
parentabbb894ff58cff160f81954d794d009c3cb92eb9
[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/test/tools/llvm-objcopy/Inputs/compress-debug-sections.yaml [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/compress-debug-sections-default-gnu.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/compress-debug-sections-default.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/compress-debug-sections-invalid-format.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib-gnu.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/compress-debug-sections-zlib.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/ObjcopyOpts.td
llvm/tools/llvm-objcopy/Object.cpp
llvm/tools/llvm-objcopy/Object.h
llvm/tools/llvm-objcopy/llvm-objcopy.cpp