From 4320c6919860634baf2207d9a642a9fbd9efc3d5 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Fri, 6 Jun 2014 16:23:21 -0700 Subject: Strip .debug_gnu_pubnames and .debug_gnu_pubtypes when building .gdb_index. When not stripping those sections, there was a bug where gold was incorrectly adjusting section-relative offsets by the offset of the input section within the output section. That adjustment was both unnecessary and wrong, causing gold to miss a number of debug entries that should have been added to .gdb_index. (With stripping, the adjustment was always 0, so the bug in dwarf_reader.cc would have been hidden by the change to layout.cc.) gold/ * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_. * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise. (Dwarf_pubnames_table::read_header): Likewise. * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and .debug_gnu_pubtypes. --- gold/dwarf_reader.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'gold/dwarf_reader.h') diff --git a/gold/dwarf_reader.h b/gold/dwarf_reader.h index 8dd62ad..cac413b 100644 --- a/gold/dwarf_reader.h +++ b/gold/dwarf_reader.h @@ -401,7 +401,7 @@ class Dwarf_pubnames_table : dwinfo_(dwinfo), buffer_(NULL), buffer_end_(NULL), owns_buffer_(false), offset_size_(0), pinfo_(NULL), end_of_table_(NULL), is_pubtypes_(is_pubtypes), is_gnu_style_(false), - output_section_offset_(0), unit_length_(0), cu_offset_(0) + unit_length_(0), cu_offset_(0) { } ~Dwarf_pubnames_table() @@ -455,11 +455,6 @@ class Dwarf_pubnames_table // Gnu-style pubnames table. This style has an extra flag byte between the // offset and the name, and is used for generating version 7 of gdb-index. bool is_gnu_style_; - // For incremental update links, this will hold the offset of the - // input section within the output section. Offsets read from - // relocated data will be relative to the output section, and need - // to be corrected before reading data from the input section. - uint64_t output_section_offset_; // Fields read from the header. uint64_t unit_length_; off_t cu_offset_; -- cgit v1.1