This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold patch obvious] Fix dwarf reader to recognize compressed debug sections by name
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Tue, 16 Nov 2010 17:51:08 -0800
- Subject: [gold patch obvious] Fix dwarf reader to recognize compressed debug sections by name
Another problem found in PR 12220 is that gold does not do ODR
detection or print source line information when the debug information
is compressed. This was caused by a simple failure to recognize the
".zdebug_line" section name. I'm committing this patch as obvious.
-cary
* dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
Check for ".zdebug_line".
Index: dwarf_reader.cc
===================================================================
RCS file: /cvs/src/src/gold/dwarf_reader.cc,v
retrieving revision 1.27
diff -u -p -r1.27 dwarf_reader.cc
--- dwarf_reader.cc 12 Jul 2010 17:59:58 -0000 1.27
+++ dwarf_reader.cc 17 Nov 2010 01:41:30 -0000
@@ -68,16 +68,19 @@ Sized_dwarf_line_info<size, big_endian>:
directories_(), files_(), current_header_index_(-1)
{
unsigned int debug_shndx;
- for (debug_shndx = 0; debug_shndx < object->shnum(); ++debug_shndx)
- // FIXME: do this more efficiently: section_name() isn't super-fast
- if (object->section_name(debug_shndx) == ".debug_line")
- {
- section_size_type buffer_size;
- this->buffer_ = object->section_contents(debug_shndx, &buffer_size,
- false);
- this->buffer_end_ = this->buffer_ + buffer_size;
- break;
- }
+ for (debug_shndx = 1; debug_shndx < object->shnum(); ++debug_shndx)
+ {
+ // FIXME: do this more efficiently: section_name() isn't super-fast
+ std::string name = object->section_name(debug_shndx);
+ if (name == ".debug_line" || name == ".zdebug_line")
+ {
+ section_size_type buffer_size;
+ this->buffer_ = object->section_contents(debug_shndx, &buffer_size,
+ false);
+ this->buffer_end_ = this->buffer_ + buffer_size;
+ break;
+ }
+ }
if (this->buffer_ == NULL)
return;