aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-06 05:11:50 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-06 05:11:50 +0000
commit7fbd77715febc18cc7b5e7eca98c03d033a1f1e4 (patch)
tree31bf2f1bd12779fdcbf86a50e3a418cee4d1d541 /src/common/linux
parentBreakpad: Avoid using the C++ <cfoo> headers. (diff)
downloadbreakpad-7fbd77715febc18cc7b5e7eca98c03d033a1f1e4.tar.xz
Linux: Skip sections of type SHT_NOBITS when loading symbols.
Review URL: http://breakpad.appspot.com/120001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@620 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux')
-rw-r--r--src/common/linux/dump_symbols.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index d8a78942..c3395d86 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -111,15 +111,22 @@ static const ElfW(Shdr) *FindSectionByName(const char *name,
// Find the end of the section name section, to make sure that
// comparisons don't run off the end of the section.
- const char *names_end =
+ const char *names_end =
reinterpret_cast<char*>(section_names->sh_offset + section_names->sh_size);
for (int i = 0; i < nsection; ++i) {
const char *section_name =
reinterpret_cast<char*>(section_names->sh_offset + sections[i].sh_name);
if (names_end - section_name >= name_len + 1 &&
- strcmp(name, section_name) == 0)
+ strcmp(name, section_name) == 0) {
+ if (sections[i].sh_type == SHT_NOBITS) {
+ fprintf(stderr,
+ "Section %s found, but ignored because type=SHT_NOBITS.\n",
+ name);
+ return NULL;
+ }
return sections + i;
+ }
}
return NULL;
}
@@ -313,7 +320,7 @@ static bool LoadDwarfCFI(const string &dwarf_filename,
byte_reader.SetDataBase(got_section->sh_addr);
if (text_section)
byte_reader.SetTextBase(text_section->sh_addr);
-
+
dwarf2reader::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename,
section_name);
dwarf2reader::CallFrameInfo parser(cfi, cfi_size,