authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-27 20:51:38+02:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-28 03:48:18-04:00
logdf7db0c4beae6c491a4354a8fd10bf30b11c8e5d
treef7dcb3f0181647d667d5b111097a2b236ac34502
parent2be1250f244a362b832cfc3d519a27363495f130

x86_64: pass behavior tests PIC and non-PIC


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

src/arch/x86_64/CodeGen.zig+3-4
......@@ -10013,7 +10013,7 @@ fn genCall(self: *Self, info: union(enum) {
1001310013 const sym = elf_file.symbol(sym_index);
1001410014 _ = try sym.getOrCreateZigGotEntry(sym_index, elf_file);
1001510015 if (self.bin_file.options.pic) {
10016 try self.genSetReg(.rax, Type.usize, .{ .lea_symbol = sym.esym_index });
10016 try self.genSetReg(.rax, Type.usize, .{ .load_symbol = sym.esym_index });
1001710017 try self.asmRegister(.{ ._, .call }, .rax);
1001810018 } else {
1001910019 _ = try self.addInst(.{
......@@ -12766,7 +12766,7 @@ fn genLazySymbolRef(
1276612766
1276712767 if (self.bin_file.options.pic) {
1276812768 switch (tag) {
12769 .lea, .call => try self.genSetReg(reg, Type.usize, .{ .lea_symbol = sym.esym_index }),
12769 .lea, .call => try self.genSetReg(reg, Type.usize, .{ .load_symbol = sym.esym_index }),
1277012770 .mov => try self.genSetReg(reg, Type.usize, .{ .load_symbol = sym.esym_index }),
1277112771 else => unreachable,
1277212772 }
......@@ -12782,7 +12782,7 @@ fn genLazySymbolRef(
1278212782 };
1278312783 switch (tag) {
1278412784 .lea, .mov => _ = try self.addInst(.{
12785 .tag = tag,
12785 .tag = .mov,
1278612786 .ops = .linker_reloc,
1278712787 .data = .{ .rx = .{
1278812788 .r1 = reg.to64(),
......@@ -14686,7 +14686,6 @@ fn resolveInst(self: *Self, ref: Air.Inst.Ref) InnerError!MCValue {
1468614686 .ty = ty,
1468714687 .val = ip_index.toValue(),
1468814688 });
14689 std.debug.print("genTypedValue: {any}\n", .{mcv});
1469014689 if (!gop.found_existing) gop.value_ptr.* = InstTracking.init(mcv);
1469114690 break :mcv gop.value_ptr.short;
1469214691 };