mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
elf: fix r_offset when emitting relocs for the linker
This commit is contained in:
parent
7c5c59191e
commit
96f221236d
@ -558,7 +558,7 @@ pub fn writeRelaSections(self: ZigObject, elf_file: *Elf) !void {
|
||||
while (true) {
|
||||
for (atom.relocs(elf_file)) |rel| {
|
||||
const target = elf_file.symbol(self.symbol(rel.r_sym()));
|
||||
const r_offset = target.value + rel.r_offset;
|
||||
const r_offset = atom.value + rel.r_offset;
|
||||
const r_sym: u32 = if (target.flags.global)
|
||||
(target.esym_index & symbol_mask) + @as(u32, @intCast(self.local_esyms.slice().len))
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user