diff options
author | Cary Coutant <ccoutant@google.com> | 2014-06-06 16:23:21 -0700 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2014-06-06 16:24:30 -0700 |
commit | 4320c6919860634baf2207d9a642a9fbd9efc3d5 (patch) | |
tree | 54f6adffda34dbb3a69c3d51bf2c7c70a9c9119b /gold/dwarf_reader.cc | |
parent | 25326a285b3aea10ea9acd63b6187ae78b59b09e (diff) | |
download | binutils-gdb-4320c6919860634baf2207d9a642a9fbd9efc3d5.tar.gz |
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.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index bc9e85f99a0..df14bd5ad3e 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -505,13 +505,11 @@ Dwarf_pubnames_table::read_section(Relobj* object, const unsigned char* symtab, if (strcmp(section_name_suffix, name) == 0) { shndx = i; - this->output_section_offset_ = object->output_section_offset(i); break; } else if (strcmp(section_name_suffix, gnu_name) == 0) { shndx = i; - this->output_section_offset_ = object->output_section_offset(i); this->is_gnu_style_ = true; break; } @@ -560,11 +558,6 @@ Dwarf_pubnames_table::read_header(off_t offset) // Make sure we have actually read the section. gold_assert(this->buffer_ != NULL); - // Correct the offset. For incremental update links, we have a - // relocated offset that is relative to the output section, but - // here we need an offset relative to the input section. - offset -= this->output_section_offset_; - if (offset < 0 || offset + 14 >= this->buffer_end_ - this->buffer_) return false; |