commit 2cdbad6f10ec5a3d07de3d02a2f0cb9e9660bd58 (tree)
parent b7b63855d04c8a757b9c33982cccf538676256ad
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Sat, 9 Mar 2024 19:34:34 +0100
elf+aarch64: handle PREL64 reloc
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/link/Elf/Atom.zig b/src/link/Elf/Atom.zig
@@ -1666,6 +1666,7 @@ const aarch64 = struct {
.LDST64_ABS_LO12_NC,
.LDST128_ABS_LO12_NC,
.PREL32,
+ .PREL64,
=> {},
else => try atom.reportUnhandledRelocError(rel, elf_file),
@@ -1727,6 +1728,11 @@ const aarch64 = struct {
mem.writeInt(u32, code, @bitCast(value), .little);
},
+ .PREL64 => {
+ const value = S + A - P;
+ mem.writeInt(u64, code_buffer[r_offset..][0..8], @bitCast(value), .little);
+ },
+
.ADR_PREL_PG_HI21 => {
// TODO: check for relaxation of ADRP+ADD
const saddr = @as(u64, @intCast(P));