Skip to content

Commit 1bcfd2a

Browse files
committed
Fix issues with buildbots.
Extra symbols were being added to the symbol table via the new dynamic symtab loading code. I moved this functionality so we only do it if we need to and avoid the extra symbols.
1 parent 4dbb6fe commit 1bcfd2a

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,31 +3008,30 @@ void ObjectFileELF::ParseSymtab(Symtab &lldb_symtab) {
30083008
// section, nomatter if .symtab was already parsed or not. This is because
30093009
// minidebuginfo normally removes the .symtab symbols which have their
30103010
// matching .dynsym counterparts.
3011-
Section *dynsym = nullptr;
30123011
if (!symtab ||
30133012
GetSectionList()->FindSectionByName(ConstString(".gnu_debugdata"))) {
3014-
dynsym =
3013+
Section *dynsym =
30153014
section_list->FindSectionByType(eSectionTypeELFDynamicSymbols, true)
30163015
.get();
30173016
if (dynsym) {
30183017
auto [num_symbols, address_class_map] =
30193018
ParseSymbolTable(&lldb_symtab, symbol_id, dynsym);
30203019
symbol_id += num_symbols;
30213020
m_address_class_map.merge(address_class_map);
3022-
}
3023-
}
3024-
if (!dynsym) {
3025-
// Try and read the dynamic symbol table from the .dynamic section.
3026-
uint32_t num_symbols = 0;
3027-
std::optional<DataExtractor> symtab_data =
3028-
GetDynsymDataFromDynamic(num_symbols);
3029-
std::optional<DataExtractor> strtab_data = GetDynstrData();
3030-
if (symtab_data && strtab_data) {
3031-
auto [num_symbols_parsed, address_class_map] =
3032-
ParseSymbols(&lldb_symtab, symbol_id, section_list, num_symbols,
3033-
symtab_data.value(), strtab_data.value());
3034-
symbol_id += num_symbols_parsed;
3035-
m_address_class_map.merge(address_class_map);
3021+
} else {
3022+
// Try and read the dynamic symbol table from the .dynamic section.
3023+
uint32_t dynamic_num_symbols = 0;
3024+
std::optional<DataExtractor> symtab_data =
3025+
GetDynsymDataFromDynamic(dynamic_num_symbols);
3026+
std::optional<DataExtractor> strtab_data = GetDynstrData();
3027+
if (symtab_data && strtab_data) {
3028+
auto [num_symbols_parsed, address_class_map] =
3029+
ParseSymbols(&lldb_symtab, symbol_id, section_list,
3030+
dynamic_num_symbols, symtab_data.value(),
3031+
strtab_data.value());
3032+
symbol_id += num_symbols_parsed;
3033+
m_address_class_map.merge(address_class_map);
3034+
}
30363035
}
30373036
}
30383037

0 commit comments

Comments
 (0)