elf: correctly set symtab's sh_info to first global index

This commit is contained in:
Jakub Konka 2023-09-02 22:12:49 +02:00
parent 9bd60bef2a
commit cfc0429bc9

View File

@ -3109,6 +3109,7 @@ fn writeSymbols(self: *Elf) !void {
.p32 => @alignOf(elf.Elf32_Sym),
.p64 => @alignOf(elf.Elf64_Sym),
};
shdr.sh_info = @intCast(self.local_symbols.items.len);
const nsyms = self.local_symbols.items.len + self.global_symbols.items.len;
const needed_size = nsyms * sym_size;
try self.growNonAllocSection(self.symtab_section_index.?, needed_size, sym_align, true);