Support ZLIB compressed debug sections
authorttsugrii <ttsugrii@fb.com>
Tue, 24 May 2016 01:45:32 +0000 (18:45 -0700)
committerTaras Tsugrii <ttsugrii@fb.com>
Mon, 20 Jun 2016 16:32:09 +0000 (09:32 -0700)
commitdc2e440dfd3bc0a67cdfdadbd42a38833ab4ea08
tree590ef474fc7500f651195fcb9c47e7e6cea2b54c
parent09e84e0520d3eb9d9ff5726ec7dc869e27ea9c54
Support ZLIB compressed debug sections

objcopy --compress-debug-sections uses ZLIB compression to reduce debug
sections, which can sometimes be larger than the size of the binary
itself. This change makes pyelftools consider compressed debug sections
when checking for DWARF data.

readelf tool supports other types of compressed sections
(https://github.com/facebook/binutils/blob/master/binutils/readelf.c#L12038)
but their support is outside of scope of this change.

Test plan:
  $ ./test/run_all_unittests.py

Signed-off-by: Stanislas P1kachu Lejay <p1kachu@lse.epita.fr>
elftools/dwarf/dwarfinfo.py
elftools/elf/elffile.py
scripts/readelf.py
test/run_readelf_tests.py
test/testfiles_for_readelf/exe_compressed64.elf [new file with mode: 0644]