| ... | ... | @@ -3100,7 +3100,6 @@ fn elf32SymFromSym(sym: elf.Elf64_Sym, out: *elf.Elf32_Sym) void { |
| 3100 | 3100 | |
| 3101 | 3101 | fn writeSymbols(self: *Elf) !void { |
| 3102 | 3102 | const gpa = self.base.allocator; |
| 3103 | | const shdr = &self.sections.items(.shdr)[self.symtab_section_index.?]; |
| 3104 | 3103 | const sym_size: u64 = switch (self.ptr_width) { |
| 3105 | 3104 | .p32 => @sizeOf(elf.Elf32_Sym), |
| 3106 | 3105 | .p64 => @sizeOf(elf.Elf64_Sym), |
| ... | ... | @@ -3109,7 +3108,11 @@ fn writeSymbols(self: *Elf) !void { |
| 3109 | 3108 | .p32 => @alignOf(elf.Elf32_Sym), |
| 3110 | 3109 | .p64 => @alignOf(elf.Elf64_Sym), |
| 3111 | 3110 | }; |
| 3111 | |
| 3112 | const shdr = &self.sections.items(.shdr)[self.symtab_section_index.?]; |
| 3112 | 3113 | shdr.sh_info = @intCast(self.local_symbols.items.len); |
| 3114 | self.markDirty(self.symtab_section_index.?, null); |
| 3115 | |
| 3113 | 3116 | const nsyms = self.local_symbols.items.len + self.global_symbols.items.len; |
| 3114 | 3117 | const needed_size = nsyms * sym_size; |
| 3115 | 3118 | try self.growNonAllocSection(self.symtab_section_index.?, needed_size, sym_align, true); |