Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Show First 20 Lines • Show All 2,217 Lines • ▼ Show 20 Lines | if (arch.IsValid()) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// symbol_value_offset may contain 0 for ARM symbols or -1 for THUMB | // symbol_value_offset may contain 0 for ARM symbols or -1 for THUMB | ||||
// symbols. See above for more details. | // symbols. See above for more details. | ||||
uint64_t symbol_value = symbol.st_value + symbol_value_offset; | uint64_t symbol_value = symbol.st_value + symbol_value_offset; | ||||
if (symbol_section_sp == nullptr && shndx == SHN_ABS && | |||||
symbol.st_size != 0) { | |||||
// We don't have a section for a symbol with non-zero size. Create a new | |||||
// section for it so the address range covered by the symbol is also | |||||
// covered by the module (represented through the section list). It is | |||||
// needed so module lookup for the addresses covered by this symbol will | |||||
// be successfull. This case happens for absolute symbols. | |||||
ConstString fake_section_name(std::string(".absolute.") + symbol_name); | |||||
symbol_section_sp = | |||||
std::make_shared<Section>(module_sp, this, SHN_ABS, fake_section_name, | |||||
eSectionTypeAbsoluteAddress, symbol_value, | |||||
symbol.st_size, 0, 0, 0, SHF_ALLOC); | |||||
module_section_list->AddSection(symbol_section_sp); | |||||
section_list->AddSection(symbol_section_sp); | |||||
} | |||||
if (symbol_section_sp && | if (symbol_section_sp && | ||||
CalculateType() != ObjectFile::Type::eTypeObjectFile) | CalculateType() != ObjectFile::Type::eTypeObjectFile) | ||||
symbol_value -= symbol_section_sp->GetFileAddress(); | symbol_value -= symbol_section_sp->GetFileAddress(); | ||||
if (symbol_section_sp && module_section_list && | if (symbol_section_sp && module_section_list && | ||||
module_section_list != section_list) { | module_section_list != section_list) { | ||||
ConstString sect_name = symbol_section_sp->GetName(); | ConstString sect_name = symbol_section_sp->GetName(); | ||||
auto section_it = section_name_to_section.find(sect_name.GetCString()); | auto section_it = section_name_to_section.find(sect_name.GetCString()); | ||||
▲ Show 20 Lines • Show All 1,196 Lines • Show Last 20 Lines |