aboutsummaryrefslogtreecommitdiff
path: root/src/link/Elf
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-08-13 09:56:17 +0200
committerJakub Konka <kubkon@jakubkonka.com>2024-08-13 13:30:24 +0200
commitd25c93a868585e4e2f5941fcff15fa49c90510e9 (patch)
tree191902004783169c5c4fadb5a50e4af5ab87793a /src/link/Elf
parentffcf0478fe646569465ac509b3e60faadd9b3697 (diff)
downloadzig-d25c93a868585e4e2f5941fcff15fa49c90510e9.tar.gz
zig-d25c93a868585e4e2f5941fcff15fa49c90510e9.zip
x86_64: emit call rel32 for near calls with linker reloc
Diffstat (limited to 'src/link/Elf')
-rw-r--r--src/link/Elf/Atom.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/link/Elf/Atom.zig b/src/link/Elf/Atom.zig
index 31ba0d642e..32583b39d7 100644
--- a/src/link/Elf/Atom.zig
+++ b/src/link/Elf/Atom.zig
@@ -1215,12 +1215,11 @@ const x86_64 = struct {
);
},
- .PLT32 => try cwriter.writeInt(i32, @as(i32, @intCast(S + A - P)), .little),
-
- .PC32 => {
+ .PLT32 => {
const S_ = if (target.flags.zig_jump_table) ZJT else S;
try cwriter.writeInt(i32, @as(i32, @intCast(S_ + A - P)), .little);
},
+ .PC32 => try cwriter.writeInt(i32, @as(i32, @intCast(S + A - P)), .little),
.GOTPCREL => try cwriter.writeInt(i32, @as(i32, @intCast(G + GOT + A - P)), .little),
.GOTPC32 => try cwriter.writeInt(i32, @as(i32, @intCast(GOT + A - P)), .little),
@@ -1620,7 +1619,7 @@ const x86_64 = struct {
const bits = @import("../../arch/x86_64/bits.zig");
const encoder = @import("../../arch/x86_64/encoder.zig");
const Disassembler = @import("../../arch/x86_64/Disassembler.zig");
- const Immediate = bits.Immediate;
+ const Immediate = Instruction.Immediate;
const Instruction = encoder.Instruction;
};