Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: src/common/linux/dump_symbols.cc

Issue 1824063002: Have dump_syms output the full symbol table. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Reverted to #2 plus SHT_DYNSYM fix Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/common/linux/dump_symbols.cc
diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
index d6c593fa3fd37bd0b4620ec96efc83ddc6d7b550..5d2aac7ecb27e6324cf42ea11d3dd838aaa107e0 100644
--- a/src/common/linux/dump_symbols.cc
+++ b/src/common/linux/dump_symbols.cc
@@ -684,32 +684,61 @@ bool LoadSymbols(const string& obj_file,
}
// See if there are export symbols available.
- const Shdr* dynsym_section =
- FindElfSectionByName<ElfClass>(".dynsym", SHT_DYNSYM,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* dynstr_section =
- FindElfSectionByName<ElfClass>(".dynstr", SHT_STRTAB,
- sections, names, names_end,
- elf_header->e_shnum);
- if (dynsym_section && dynstr_section) {
- info->LoadedSection(".dynsym");
+ const Shdr* symtab_section =
+ FindElfSectionByName<ElfClass>(".symtab", SHT_SYMTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ const Shdr* strtab_section =
+ FindElfSectionByName<ElfClass>(".strtab", SHT_STRTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ if (symtab_section && strtab_section) {
+ info->LoadedSection(".symtab");
- const uint8_t* dynsyms =
+ const uint8_t* symtab =
GetOffset<ElfClass, uint8_t>(elf_header,
- dynsym_section->sh_offset);
- const uint8_t* dynstrs =
+ symtab_section->sh_offset);
+ const uint8_t* strtab =
GetOffset<ElfClass, uint8_t>(elf_header,
- dynstr_section->sh_offset);
+ strtab_section->sh_offset);
bool result =
- ELFSymbolsToModule(dynsyms,
- dynsym_section->sh_size,
- dynstrs,
- dynstr_section->sh_size,
+ ELFSymbolsToModule(symtab,
+ symtab_section->sh_size,
+ strtab,
+ strtab_section->sh_size,
big_endian,
ElfClass::kAddrSize,
module);
found_usable_info = found_usable_info || result;
+ } else {
+ // Look in dynsym only if full symbol table was not available.
+ const Shdr* dynsym_section =
+ FindElfSectionByName<ElfClass>(".dynsym", SHT_DYNSYM,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ const Shdr* dynstr_section =
+ FindElfSectionByName<ElfClass>(".dynstr", SHT_STRTAB,
+ sections, names, names_end,
+ elf_header->e_shnum);
+ if (dynsym_section && dynstr_section) {
+ info->LoadedSection(".dynsym");
+
+ const uint8_t* dynsyms =
+ GetOffset<ElfClass, uint8_t>(elf_header,
+ dynsym_section->sh_offset);
+ const uint8_t* dynstrs =
+ GetOffset<ElfClass, uint8_t>(elf_header,
+ dynstr_section->sh_offset);
+ bool result =
+ ELFSymbolsToModule(dynsyms,
+ dynsym_section->sh_size,
+ dynstrs,
+ dynstr_section->sh_size,
+ big_endian,
+ ElfClass::kAddrSize,
+ module);
+ found_usable_info = found_usable_info || result;
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698