diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-05-14 15:58:51 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-05-14 16:02:08 -0700 |
commit | dab394de9e41de54df5e2310e081e1c550326f5b (patch) | |
tree | fbdbe4f564baa35e7fb4bea28416a531fcb9d916 /bfd/bfd-in2.h | |
parent | 61a7418ccb7c2de12d4c4df79e193f32db938a11 (diff) | |
download | gdb-dab394de9e41de54df5e2310e081e1c550326f5b.zip gdb-dab394de9e41de54df5e2310e081e1c550326f5b.tar.gz gdb-dab394de9e41de54df5e2310e081e1c550326f5b.tar.bz2 |
Don't add the zlib header to SHF_COMPRESSED section
In a SHF_COMPRESSED compressed section, the raw compressed data should
begin immediately after the compression header. This patch removes the
extra zlib header from the SHF_COMPRESSED section.
bfd/
* bfd.c (bfd_update_compression_header): Also write the zlib
header if the SHF_COMPRESSED bit cleared..
(bfd_check_compression_header): Return the uncompressed size.
* compress.c (decompress_contents): Don't skip the zlib header.
(bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
which doesn't have the zlib header.
(bfd_init_section_decompress_status): Likewise.
(bfd_get_full_section_contents): Updated.
(bfd_is_section_compressed): Likewise.
(bfd_is_section_compressed_with_header): Return the uncompressed
size.
* elf.c (_bfd_elf_make_section_from_shdr): Updated.
* bfd-in2.h: Regenerated.
binutils/
* readelf.c (uncompress_section_contents): Add a parameter for
uncompressed size. Don't check the zlib header.
(load_specific_debug_section): Updated.
binutils/testsuite/
* binutils-all/compress.exp: Replace "$OBJDUMP -s -j .debug_info"
with "$OBJDUMP -W".
* binutils-all/libdw2-compressedgabi.out: Updated.
gas/
2015-05-14 H.J. Lu <hongjiu.lu@intel.com>
* write.c (compress_debug): Don't write the zlib header, which
is handled by bfd_update_compression_header.
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r-- | bfd/bfd-in2.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index ade49ff..6f7ae34 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6816,7 +6816,7 @@ void bfd_update_compression_header bfd_boolean bfd_check_compression_header (bfd *abfd, bfd_byte *contents, asection *sec, - bfd_size_type uncompressed_size); + bfd_size_type *uncompressed_size); int bfd_get_compression_header_size (bfd *abfd, asection *sec); @@ -7334,7 +7334,8 @@ void bfd_cache_section_contents bfd_boolean bfd_is_section_compressed_with_header (bfd *abfd, asection *section, - int *compression_header_size_p); + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p); bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); |