| ... | @@ -333,7 +333,7 @@ pub const Relocation = struct { | ... | @@ -333,7 +333,7 @@ pub const Relocation = struct { |
| 333 | }; | 333 | }; |
| 334 | | 334 | |
| 335 | pub const Signed = struct { | 335 | pub const Signed = struct { |
| 336 | addend: i32, | 336 | addend: i64, |
| 337 | correction: i4, | 337 | correction: i4, |
| 338 | | 338 | |
| 339 | pub fn resolve(self: Signed, base: Relocation, source_addr: u64, target_addr: u64) !void { | 339 | pub fn resolve(self: Signed, base: Relocation, source_addr: u64, target_addr: u64) !void { |
| ... | @@ -874,13 +874,13 @@ pub const Parser = struct { | ... | @@ -874,13 +874,13 @@ pub const Parser = struct { |
| 874 | .X86_64_RELOC_SIGNED_4 => 4, | 874 | .X86_64_RELOC_SIGNED_4 => 4, |
| 875 | else => unreachable, | 875 | else => unreachable, |
| 876 | }; | 876 | }; |
| 877 | var addend = mem.readIntLittle(i32, self.block.code[parsed.offset..][0..4]) + correction; | 877 | var addend: i64 = mem.readIntLittle(i32, self.block.code[parsed.offset..][0..4]) + correction; |
| 878 | | 878 | |
| 879 | if (rel.r_extern == 0) { | 879 | if (rel.r_extern == 0) { |
| 880 | const source_sym = self.zld.locals.items[self.block.local_sym_index].payload.regular; | 880 | const source_sym = self.zld.locals.items[self.block.local_sym_index].payload.regular; |
| 881 | const source_addr = source_sym.address + parsed.offset + @intCast(u32, addend) + 4; | 881 | const source_addr = source_sym.address + parsed.offset + @intCast(u32, addend) + 4; |
| 882 | const target_sym = parsed.target.payload.regular; | 882 | const target_sym = parsed.target.payload.regular; |
| 883 | addend = try math.cast(i32, @intCast(i64, source_addr) - @intCast(i64, target_sym.address)); | 883 | addend = @intCast(i64, source_addr) - @intCast(i64, target_sym.address); |
| 884 | } | 884 | } |
| 885 | | 885 | |
| 886 | parsed.payload = .{ | 886 | parsed.payload = .{ |