* Makefile.am (BFD32_LIBS): Add compress.lo.
	(BFD32_LIBS_CFILES): Add compress.c.
	(BFD_H_FILES): Likewise.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf2.c (read_section): New function.
	(read_indirect_string): Call new function read_section.
	(read_abbrevs): Likewise.
	(decode_line_info): Likewise.
	(read_debug_ranges): Likewise.
	(find_line): Call new function read_section when just one
	.zdebug_info section is found, otherwise read and compress
	multiple sections.
	(_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
	* elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
	(special_sections_z): New struct.
	(special_sections): Refer to special_sections_z.
	* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
	sections named .zdebug_*.
	(_bfd_mips_elf_fake_sections): Likewise.
	* compress.c: New file.
	(bfd_uncompress_section_contents): New function.
bfd/doc/
	* Makefile.am (BFD_H_DEP): Add ../compress.c.
	* Makefile.in: Regenerate.
binutils/
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf.c (debug_displays): Add .zdebug_* strings.
	* dwarf.h (struct dwarf_section): Add fields uncompressed_namd
	and compressed_name.
	* objdump.c (load_debug_section): Call
	bfd_uncompress_section_contents when loading a compressed
	section.
	(dump_dwarf_section): Recognize compressed section name.
	(mach_o_dwarf_sections): Rename as
	mach_o_uncompressed_dwarf_sections.
	(mach_o_compressed_dwarf_sections): New variable.
	(generic_dwarf_section): Rename as
	generic_uncompressed_dwarf_sections.
	(generic_compressed_dwarf_sections): New variable.
	(check_mach_o_dwarf): Save and restore
	mach_o_compressed_dwarf_sections.
	* readelf.c: Add #include for config.h and zlib.h
	(process_section_headers): Recognize compressed section name.
	(uncompress_section_contents): New function.
	(load_debug_section): Call uncompress_section_contents when
	loading a compressed section.
	(display_debug_section): Recognize compressed section name.
binutils/testsuite:
	* binutils-all/objdump.exp: Add test for objdump -s on a file
	with a compressed debug section.  Add test for objdump -W on a
	file that contains a compressed debug section.
	* binutils-all/readelf.exp: Call readelf_compressed_wa_test.
	(readelf_compressed_wa_test): New function.
	* binutils-all/dw2-compressed.S: New file.
	* binutils-all/objdump.W: New file.
	* binutils-all/objdump.s: New file.
	* binutils-all/readelf.wa: New file.
This commit is contained in:
Craig Silverstein
2008-07-10 01:32:23 +00:00
parent 67f9f80fe8
commit 1b31505692
31 changed files with 1968 additions and 799 deletions

View File

@ -4613,36 +4613,36 @@ free_debug_memory (void)
struct dwarf_section_display debug_displays[] =
{
{ { ".debug_abbrev", NULL, 0, 0 },
{ { ".debug_abbrev", ".zdebug_abbrev", NULL, NULL, 0, 0 },
display_debug_abbrev, 0, 0 },
{ { ".debug_aranges", NULL, 0, 0 },
{ { ".debug_aranges", ".zdebug_aranges", NULL, NULL, 0, 0 },
display_debug_aranges, 0, 0 },
{ { ".debug_frame", NULL, 0, 0 },
{ { ".debug_frame", ".zdebug_frame", NULL, NULL, 0, 0 },
display_debug_frames, 1, 0 },
{ { ".debug_info", NULL, 0, 0 },
{ { ".debug_info", ".zdebug_info", NULL, NULL, 0, 0 },
display_debug_info, 1, 0 },
{ { ".debug_line", NULL, 0, 0 },
{ { ".debug_line", ".zdebug_line", NULL, NULL, 0, 0 },
display_debug_lines, 0, 0 },
{ { ".debug_pubnames", NULL, 0, 0 },
{ { ".debug_pubnames", ".zdebug_pubnames", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
{ { ".eh_frame", NULL, 0, 0 },
{ { ".eh_frame", "", NULL, NULL, 0, 0 },
display_debug_frames, 1, 1 },
{ { ".debug_macinfo", NULL, 0, 0 },
{ { ".debug_macinfo", ".zdebug_macinfo", NULL, NULL, 0, 0 },
display_debug_macinfo, 0, 0 },
{ { ".debug_str", NULL, 0, 0 },
{ { ".debug_str", ".zdebug_str", NULL, NULL, 0, 0 },
display_debug_str, 0, 0 },
{ { ".debug_loc", NULL, 0, 0 },
{ { ".debug_loc", ".zdebug_loc", NULL, NULL, 0, 0 },
display_debug_loc, 0, 0 },
{ { ".debug_pubtypes", NULL, 0, 0 },
{ { ".debug_pubtypes", ".zdebug_pubtypes", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
{ { ".debug_ranges", NULL, 0, 0 },
{ { ".debug_ranges", ".zdebug_ranges", NULL, NULL, 0, 0 },
display_debug_ranges, 0, 0 },
{ { ".debug_static_func", NULL, 0, 0 },
{ { ".debug_static_func", ".zdebug_static_func", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_static_vars", NULL, 0, 0 },
{ { ".debug_static_vars", ".zdebug_static_vars", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_types", NULL, 0, 0 },
{ { ".debug_types", ".zdebug_types", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
{ { ".debug_weaknames", NULL, 0, 0 },
{ { ".debug_weaknames", ".zdebug_weaknames", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 }
};