From 2f3884ca1d8953a6ac811c0e722f13ef397454b7 Mon Sep 17 00:00:00 2001 From: Konrad Kleine Date: Wed, 11 Sep 2019 14:33:37 +0000 Subject: Revert "[LLDB][ELF] Load both, .symtab and .dynsym sections" This reverts commit 3a4781bbf4f39a25562b4c61c9a9ab2483a96b41. llvm-svn: 371625 --- .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 26 +++++++--------------- 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp') diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 20e26f033d1..e507f0e4d74 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2647,31 +2647,21 @@ Symtab *ObjectFileELF::GetSymtab() { // smaller version of the symtab that only contains global symbols. The // information found in the dynsym is therefore also found in the symtab, // while the reverse is not necessarily true. - // One exception to the above rule is when we have minidebuginfo embedded - // into a compressed .gnu_debugdata section. This section contains a .symtab - // from which all symbols already contained in the .dynsym are stripped. Section *symtab = section_list->FindSectionByType(eSectionTypeELFSymbolTable, true).get(); + if (!symtab) { + // The symtab section is non-allocable and can be stripped, so if it + // doesn't exist then use the dynsym section which should always be + // there. + symtab = + section_list->FindSectionByType(eSectionTypeELFDynamicSymbols, true) + .get(); + } if (symtab) { m_symtab_up.reset(new Symtab(symtab->GetObjectFile())); symbol_id += ParseSymbolTable(m_symtab_up.get(), symbol_id, symtab); } - // The symtab section is non-allocable and can be stripped, while the dynsym - // section which should always be always be there. If both exist we load - // both to support the minidebuginfo case. Otherwise we just load the dynsym - // section. - Section *dynsym = - section_list->FindSectionByType(eSectionTypeELFDynamicSymbols, true) - .get(); - if (dynsym) { - if (!m_symtab_up) { - auto sec = symtab ? symtab : dynsym; - m_symtab_up.reset(new Symtab(sec->GetObjectFile())); - } - symbol_id += ParseSymbolTable(m_symtab_up.get(), symbol_id, dynsym); - } - // DT_JMPREL // If present, this entry's d_ptr member holds the address of // relocation -- cgit v1.2.3