elf: skip STT_NOTYPE only if SHN_UNDEF from symtab inclusion

This commit is contained in:
Jakub Konka 2024-02-21 22:49:58 +01:00
parent 9fd112804f
commit d19001abac

View File

@ -848,7 +848,8 @@ pub fn updateSymtabSize(self: *Object, elf_file: *Elf) !void {
if (local.atom(elf_file)) |atom| if (!atom.flags.alive) continue;
const esym = local.elfSym(elf_file);
switch (esym.st_type()) {
elf.STT_SECTION, elf.STT_NOTYPE => continue,
elf.STT_SECTION => continue,
elf.STT_NOTYPE => if (esym.st_shndx == elf.SHN_UNDEF) continue,
else => {},
}
local.flags.output_symtab = true;