diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-06 05:11:50 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-06 05:11:50 +0000 |
commit | 7fbd77715febc18cc7b5e7eca98c03d033a1f1e4 (patch) | |
tree | 31bf2f1bd12779fdcbf86a50e3a418cee4d1d541 /src/common/linux | |
parent | Breakpad: Avoid using the C++ <cfoo> headers. (diff) | |
download | breakpad-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.cc | 13 |
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, |