aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@google.com>2008-07-10 01:32:23 +0000
committerCraig Silverstein <csilvers@google.com>2008-07-10 01:32:23 +0000
commit1b315056928c75e989b6a0fa858577141da5cc4f (patch)
tree614e9ce91f305d95088448cd17509082373d0b1d /bfd/elf.c
parent67f9f80fe82daf2c0b287fa8ccb8b96ae9e68e7f (diff)
downloadgdb-1b315056928c75e989b6a0fa858577141da5cc4f.zip
gdb-1b315056928c75e989b6a0fa858577141da5cc4f.tar.gz
gdb-1b315056928c75e989b6a0fa858577141da5cc4f.tar.bz2
bfd/
* 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.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 28a593f..d65c78d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -890,7 +890,14 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
{ NULL, 0 }, /* 'p' */
{ NULL, 0 }, /* 'q' */
{ NULL, 0 }, /* 'r' */
- { STRING_COMMA_LEN ("stab") } /* 's' */
+ { STRING_COMMA_LEN ("stab") }, /* 's' */
+ { NULL, 0 }, /* 't' */
+ { NULL, 0 }, /* 'u' */
+ { NULL, 0 }, /* 'v' */
+ { NULL, 0 }, /* 'w' */
+ { NULL, 0 }, /* 'x' */
+ { NULL, 0 }, /* 'y' */
+ { STRING_COMMA_LEN ("zdebug") } /* 'z' */
};
if (name [0] == '.')
@@ -2119,6 +2126,15 @@ static const struct bfd_elf_special_section special_sections_t[] =
{ NULL, 0, 0, 0, 0 }
};
+static const struct bfd_elf_special_section special_sections_z[] =
+{
+ { STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".zdebug_abbrev"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".zdebug_aranges"), 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
+};
+
static const struct bfd_elf_special_section *special_sections[] =
{
special_sections_b, /* 'b' */
@@ -2140,6 +2156,12 @@ static const struct bfd_elf_special_section *special_sections[] =
special_sections_r, /* 'r' */
special_sections_s, /* 's' */
special_sections_t, /* 't' */
+ NULL, /* 'u' */
+ NULL, /* 'v' */
+ NULL, /* 'w' */
+ NULL, /* 'x' */
+ NULL, /* 'y' */
+ special_sections_z /* 'z' */
};
const struct bfd_elf_special_section *
@@ -2216,7 +2238,7 @@ _bfd_elf_get_sec_type_attr (bfd *abfd, asection *sec)
return NULL;
i = sec->name[1] - 'b';
- if (i < 0 || i > 't' - 'b')
+ if (i < 0 || i > 'z' - 'b')
return NULL;
spec = special_sections[i];