mirror of
https://github.com/rui314/mold.git
synced 2024-11-12 23:48:51 +03:00
Merge pull request #809 from sicherha/fix_SHN_XINDEX_out_of_bounds
Fix name lookup for section symbols when `st_shndx == SHN_XINDEX`
This commit is contained in:
commit
f9750d163d
@ -446,7 +446,7 @@ void ObjectFile<E>::initialize_symbols(Context<E> &ctx) {
|
||||
|
||||
std::string_view name;
|
||||
if (esym.st_type == STT_SECTION)
|
||||
name = this->shstrtab.data() + this->elf_sections[esym.st_shndx].sh_name;
|
||||
name = this->shstrtab.data() + this->elf_sections[get_shndx(esym)].sh_name;
|
||||
else
|
||||
name = this->symbol_strtab.data() + esym.st_name;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user