1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00

[ELF] Do not directly read st_shndx

If st_shndx is 0xffff, the actual section index value is in a
SHT_SYMTAB_SHNDX section.
This commit is contained in:
Rui Ueyama 2022-03-01 14:47:50 +09:00
parent f2d27d8d24
commit 567a78dbd5

View File

@ -388,7 +388,7 @@ void ObjectFile<E>::initialize_symbols(Context<E> &ctx) {
sym.sym_idx = i;
if (!esym.is_abs())
sym.shndx = esym.is_abs() ? 0 : esym.st_shndx;
sym.shndx = esym.is_abs() ? 0 : get_shndx(esym);
}
this->symbols.resize(this->elf_syms.size());