authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-11-02 11:49:41+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-11-04 09:11:14+01:00
log96f221236dbea6c17d11fb41e83d9dcc12c48200
tree95ac1d9f58d9bf1708cee88e70b061642d8b7914
parent7c5c59191ec1d8879b70c47c54577e23f6262cc4

elf: fix r_offset when emitting relocs for the linker


1 files changed, 1 insertions(+), 1 deletions(-)

src/link/Elf/ZigObject.zig+1-1
......@@ -558,7 +558,7 @@ pub fn writeRelaSections(self: ZigObject, elf_file: *Elf) !void {
558558 while (true) {
559559 for (atom.relocs(elf_file)) |rel| {
560560 const target = elf_file.symbol(self.symbol(rel.r_sym()));
561 const r_offset = target.value + rel.r_offset;
561 const r_offset = atom.value + rel.r_offset;
562562 const r_sym: u32 = if (target.flags.global)
563563 (target.esym_index & symbol_mask) + @as(u32, @intCast(self.local_esyms.slice().len))
564564 else