mirror of
https://github.com/ziglang/zig.git
synced 2026-02-07 06:57:13 +00:00
elf: fix off-by-one when referring to resolved table directly
This commit is contained in:
parent
0a198789f1
commit
835f1fc03f
@ -1119,7 +1119,7 @@ pub fn updateSymtabSize(self: *Object, elf_file: *Elf) void {
|
||||
}
|
||||
|
||||
for (self.globals(), self.symbols_resolver.items) |*global, resolv| {
|
||||
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 (!isAlive(global, elf_file)) continue;
|
||||
@ -1146,7 +1146,7 @@ pub fn writeSymtab(self: *Object, elf_file: *Elf) void {
|
||||
}
|
||||
|
||||
for (self.globals(), self.symbols_resolver.items) |global, resolv| {
|
||||
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…
x
Reference in New Issue
Block a user