link.Elf: support R_X86_64_PC64

This commit is contained in:
rpkak
2026-04-22 09:18:52 +02:00
committed by Andrew Kelley
parent 8a113f83d4
commit 9df02121d0
+2 -1
View File
@@ -983,7 +983,7 @@ const x86_64 = struct {
}
},
.PC32 => {
.PC32, .PC64 => {
try atom.scanReloc(symbol, rel, pcRelocAction(symbol, elf_file), elf_file);
},
@@ -1083,6 +1083,7 @@ const x86_64 = struct {
.PLT32 => mem.writeInt(i32, code[r_offset..][0..4], @as(i32, @intCast(S + A - P)), .little),
.PC32 => mem.writeInt(i32, code[r_offset..][0..4], @as(i32, @intCast(S + A - P)), .little),
.PC64 => mem.writeInt(i64, code[r_offset..][0..8], S + A - P, .little),
.GOTPCREL => mem.writeInt(i32, code[r_offset..][0..4], @as(i32, @intCast(G + GOT + A - P)), .little),
.GOTPC32 => mem.writeInt(i32, code[r_offset..][0..4], @as(i32, @intCast(GOT + A - P)), .little),