Add SHF_COMPRESSED support to readelf
This patch updates readelf to dump compression header with
readelf -S -W:
[ 4] .debug_info PROGBITS
00000000 000038 00007d 00 C 0 0 1
readelf -t -W:
[ 4] .debug_info
PROGBITS
00000000 000038 00007d 00 0 0 1
[
00000800]: COMPRESSED
ZLIB,
0000009d, 1
It also checks the compression header when decompressing the compressed
section.
* readelf.c (get_elf_section_flags): Support SHF_COMPRESSED.
(get_compression_header): New.
(process_section_headers): Dump compression header if needed.
(uncompress_section_contents): Don't free compressed_buffer here.
(load_specific_debug_section): Free the compressed buffer, update
the section buffer and the section size if uncompress is
successful.