mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
elf: fix off-by-one direct access to symbol resolver in ZigObject
This commit is contained in:
parent
128289fda1
commit
90c4037819
1 changed files with 2 additions and 2 deletions
|
|
@ -598,7 +598,7 @@ pub fn updateSymtabSize(self: *ZigObject, elf_file: *Elf) !void {
|
|||
|
||||
for (self.global_symbols.items, self.symbols_resolver.items) |index, resolv| {
|
||||
const global = &self.symbols.items[index];
|
||||
const ref = elf_file.resolver.values.items[resolv];
|
||||
const ref = elf_file.resolver.values.items[resolv - 1];
|
||||
const ref_sym = elf_file.symbol(ref) orelse continue;
|
||||
if (ref_sym.file(elf_file).?.index() != self.index) continue;
|
||||
if (global.atom(elf_file)) |atom_ptr| if (!atom_ptr.alive) continue;
|
||||
|
|
@ -627,7 +627,7 @@ pub fn writeSymtab(self: ZigObject, elf_file: *Elf) void {
|
|||
|
||||
for (self.global_symbols.items, self.symbols_resolver.items) |index, resolv| {
|
||||
const global = self.symbols.items[index];
|
||||
const ref = elf_file.resolver.values.items[resolv];
|
||||
const ref = elf_file.resolver.values.items[resolv - 1];
|
||||
const ref_sym = elf_file.symbol(ref) orelse continue;
|
||||
if (ref_sym.file(elf_file).?.index() != self.index) continue;
|
||||
const idx = global.outputSymtabIndex(elf_file) orelse continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue