Skip to content

Commit

Permalink
Revert "[LLDB][ELF] Load both, .symtab and .dynsym sections"
Browse files Browse the repository at this point in the history
This reverts commit 3a4781b.

llvm-svn: 371625
  • Loading branch information
kwk committed Sep 11, 2019
1 parent d44c4a7 commit 2f3884c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 119 deletions.
7 changes: 0 additions & 7 deletions lldb/lit/Modules/ELF/Inputs/load-from-dynsym-alone.c

This file was deleted.

12 changes: 0 additions & 12 deletions lldb/lit/Modules/ELF/Inputs/load-symtab-and-dynsym.c

This file was deleted.

33 changes: 0 additions & 33 deletions lldb/lit/Modules/ELF/load-from-dynsym-alone.test

This file was deleted.

48 changes: 0 additions & 48 deletions lldb/lit/Modules/ELF/load-symtab-and-dynsym.test

This file was deleted.

2 changes: 1 addition & 1 deletion lldb/lit/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ def use_support_substitutions(config):

support_tools = ['yaml2obj', 'obj2yaml', 'llvm-pdbutil',
'llvm-mc', 'llvm-readobj', 'llvm-objdump',
'llvm-objcopy', 'lli', 'llvm-strip']
'llvm-objcopy', 'lli']
additional_tool_dirs += [config.lldb_tools_dir, config.llvm_tools_dir]
llvm_config.add_tool_substitutions(support_tools, additional_tool_dirs)
26 changes: 8 additions & 18 deletions lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f3884c

Please sign in to comment.