aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-04-29 13:38:59 +0000
committerNick Clifton <nickc@redhat.com>2013-04-29 13:38:59 +0000
commitb40bf0a25574c43114b906ba151b7895b2348794 (patch)
tree7964a382ed4b6f081640dd260954b27a7c17625e /binutils/readelf.c
parent09526ec1c28f4f31b38c271c259b7dea0993d5b0 (diff)
downloadgdb-b40bf0a25574c43114b906ba151b7895b2348794.zip
gdb-b40bf0a25574c43114b906ba151b7895b2348794.tar.gz
gdb-b40bf0a25574c43114b906ba151b7895b2348794.tar.bz2
* elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark from
fragmented .debug_line sections associated with unmarked code sections. * dwarf.c (read_debug_line_header): New function. Reads in a header in a .debug_line section. (display_debug_lines_raw): Use new function. Handle fragmentary .debug_line sections. (display_debug_lines_decoded): Likewise. * readelf.c (process_section_headers): Handle fragmenatry .debug_line sections. (display_debug_section): Likewise. * as.c (Options): Add -gdwarf-sections. (parse_args): Likewise. * as.h (flag_dwarf_sections): Declare. * dwarf2dbg.c (emit_fixed_inc_line_addr): Skip section changes. (process_entries): When -gdwarf-sections is enabled generate fragmentary .debug_line sections. (out_debug_line): Set the section for the .debug_line section end symbol. * doc/as.texinfo: Document -gdwarf-sections. * NEWS: Mention -gdwarf-sections. * gas/elf/dwarf2-3.d: Fix expected readelf output. * scripttempl/DWARF.sc: Add support for .debug_line.* and .debug_line_end.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index b7607a0..a71bf94 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4838,7 +4838,8 @@ process_section_headers (FILE * file)
|| (do_debug_info && const_strneq (name, "info"))
|| (do_debug_info && const_strneq (name, "types"))
|| (do_debug_abbrevs && const_strneq (name, "abbrev"))
- || (do_debug_lines && const_strneq (name, "line"))
+ || (do_debug_lines && strcmp (name, "line") == 0)
+ || (do_debug_lines && const_strneq (name, "line."))
|| (do_debug_pubnames && const_strneq (name, "pubnames"))
|| (do_debug_pubtypes && const_strneq (name, "pubtypes"))
|| (do_debug_aranges && const_strneq (name, "aranges"))
@@ -10972,6 +10973,7 @@ display_debug_section (int shndx, Elf_Internal_Shdr * section, FILE * file)
/* See if we know how to display the contents of this section. */
for (i = 0; i < max; i++)
if (streq (debug_displays[i].section.uncompressed_name, name)
+ || (i == line && const_strneq (name, ".debug_line."))
|| streq (debug_displays[i].section.compressed_name, name))
{
struct dwarf_section * sec = &debug_displays [i].section;
@@ -10980,7 +10982,9 @@ display_debug_section (int shndx, Elf_Internal_Shdr * section, FILE * file)
if (secondary)
free_debug_section ((enum dwarf_section_display_enum) i);
- if (streq (sec->uncompressed_name, name))
+ if (i == line && const_strneq (name, ".debug_line."))
+ sec->name = name;
+ else if (streq (sec->uncompressed_name, name))
sec->name = sec->uncompressed_name;
else
sec->name = sec->compressed_name;