diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-10-29 12:10:39 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-10-29 12:10:39 +0000 |
commit | 4a114e3e0c1c3337981179b774f1d6d1b06d201f (patch) | |
tree | 98b0b1e45b3ae0e7845215136253fa56e487a9b8 /ld/scripttempl | |
parent | e58bcb8f099ec42b3c905480629d1a49dd38b03f (diff) | |
download | gdb-4a114e3e0c1c3337981179b774f1d6d1b06d201f.zip gdb-4a114e3e0c1c3337981179b774f1d6d1b06d201f.tar.gz gdb-4a114e3e0c1c3337981179b774f1d6d1b06d201f.tar.bz2 |
Add compressed debug section support to binutils and ld.
bfd/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
Cary Coutant <ccoutant@google.com>
* archive.c (bfd_openr_next_archived_file): Copy BFD_COMPRESS
and BFD_DECOMPRESS.
* bfd.c (BFD_COMPRESS): New.
(BFD_DECOMPRESS): Likewise.
(BFD_FLAGS_SAVED): Likewise.
(bfd_preserve_save): Replace BFD_IN_MEMORY with BFD_FLAGS_SAVED.
* compress.c (bfd_uncompress_section_contents): Removed.
(get_uncompressed_size): New.
(decompress_contents): Likewise.
(bfd_compress_section_contents): Likewise.
(bfd_get_full_section_contents): Likewise.
(bfd_is_section_compressed): Likewise.
(bfd_init_section_decompress_status): Likewise.
(bfd_init_section_compress_status): Likewise.
* dwarf2.c (dwarf_debug_sections): New.
(dwarf_debug_section_enum): Likewise.
(read_section): Remove section_name and compressed_section_name.
Add dwarf_debug_section_enum. Try compressed debug section.
(read_indirect_string): Updated.
(read_abbrevs): Likewise.
(decode_line_info): Likewise.
(read_debug_ranges): Likewise.
(find_line): Updated.
* ecoff.c (bfd_debug_section): Add compress_status and
compressed_size.
* elf.c (_bfd_elf_make_section_from_shdr): Call
bfd_is_section_compressed to check if a DWARF debug section is
compressed. Call bfd_init_section_compress_status or
bfd_init_section_decompress_status if needed.
* elflink.c (elf_link_input_bfd): Replace bfd_get_section_contents
with bfd_get_full_section_contents.
* merge.c (_bfd_add_merge_section): Likewise.
* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
* simple.c (bfd_simple_get_relocated_section_contents): Likewise.
* elfxx-target.h (TARGET_BIG_SYM): Allow BFD_COMPRESS and
BFD_DECOMPRESS.
(TARGET_LITTLE_SYM): Likewise.
* libbfd-in.h (dwarf_debug_section): New.
(dwarf_debug_sections): Likewise.
* libbfd.c (_bfd_generic_get_section_contents): Issue an error
when getting contents on compressed/decompressed section.
* section.c (COMPRESS_SECTION_NONE): New.
(COMPRESS_SECTION_DONE): Likewise.
(DECOMPRESS_SECTION_SIZED): Likewise.
(BFD_FAKE_SECTION): Add compress_status and compressed_size.
(bfd_malloc_and_get_section): Replace bfd_get_section_contents
with bfd_get_full_section_contents.
* bfd-in2.h: Regenerated.
* libbfd.h: Likewise.
binutils/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* addr2line.c (process_file): Set BFD_DECOMPRESS.
* objcopy.c (do_debug_sections): New.
(OPTION_COMPRESS_DEBUG_SECTIONS): New.
(OPTION_DECOMPRESS_DEBUG_SECTIONS): Likewise.
(copy_options): Add OPTION_COMPRESS_DEBUG_SECTIONS and
OPTION_DECOMPRESS_DEBUG_SECTIONS.
(copy_usage): Add --compress-debug-sections and
--decompress-debug-sections.
(copy_file): Set BFD_COMPRESS or BFD_DECOMPRESS.
(copy_section): Replace bfd_get_section_contents with
bfd_get_full_section_contents.
(copy_main): Handle OPTION_COMPRESS_DEBUG_SECTIONS and
OPTION_DECOMPRESS_DEBUG_SECTIONS. Check do_debug_sections to
rename DWARF debug sections.
* objdump.c (load_specific_debug_section): Replace
bfd_get_section_contents with bfd_get_full_section_contents.
Remove bfd_uncompress_section_contents.
(dump_section): Replace bfd_get_section_contents with
bfd_get_full_section_contents.
(display_file): Set BFD_DECOMPRESS if needed.
* readelf.c (uncompress_section_contents): Set buffer to NULL
to indiate decompression failure.
(load_specific_debug_section): Always call
uncompress_section_contents.
* doc/binutils.texi: Document --compress-debug-sections and
--decompress-debug-sections.
binutils/testsuite/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* binutils-all/compress.exp: New.
* binutils-all/dw2-1.S: Likewise.
* binutils-all/dw2-2.S: Likewise.
* binutils-all/libdw2-compressed.out: Likewise.
* binutils-all/libdw2.out: Likewise.
gas/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* write.c (compress_debug): Optimize section flags check.
gas/testsuite/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* elf/dwarf2-1.s: Replace .zdebug_abbrev section with
.debug_abbrev section.
* elf/dwarf2-2.3: Likewise.
* elf/dwarf2-1.d: Pass --compress-debug-sections to assembler.
Updated.
* elf/dwarf2-2.d: Likewise.
* gas/i386/i386.exp: Remove xfail on dw2-compress-2 and
x86-64-dw2-compress-2.
ld/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* ldfile.c (ldfile_try_open_bfd): Set BFD_DECOMPRESS after
bfd_openr returns.
* emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Likewise.
* scripttempl/elf.sc: Include compressed DWARF debug sections.
ld/testsuite/
2010-10-29 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/compress.exp: New.
* ld-elf/compress1.s: Likewise.
* ld-elf/compress1a.d: Likewise.
* ld-elf/compress1b.d: Likewise.
* ld-elf/compress1c.d: Likewise.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r-- | ld/scripttempl/elf.sc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc index 62120fc..ac05306 100644 --- a/ld/scripttempl/elf.sc +++ b/ld/scripttempl/elf.sc @@ -572,31 +572,31 @@ cat <<EOF .line 0 : { *(.line) } /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } + .debug_srcinfo 0 : { *(.debug_srcinfo .zdebug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames .zdebug_sfnames) } /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges .zdebug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) } /* DWARF 2 */ - .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } + .debug_info 0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*} .zdebug_info) } + .debug_abbrev 0 : { *(.debug_abbrev .zdebug_abbrev) } + .debug_line 0 : { *(.debug_line .zdebug_line) } + .debug_frame 0 : { *(.debug_frame .zdebug_frame) } + .debug_str 0 : { *(.debug_str .zdebug_str) } + .debug_loc 0 : { *(.debug_loc .zdebug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo .zdebug_macinfo) } /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } + .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) } + .debug_varnames 0 : { *(.debug_varnames .zdebug_varnames) } /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } + .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges .zdebug_ranges) } ${TINY_DATA_SECTION} ${TINY_BSS_SECTION} |