diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-27 20:51:38 +0200 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-28 03:48:18 -0400 |
| commit | df7db0c4beae6c491a4354a8fd10bf30b11c8e5d (patch) | |
| tree | f7dcb3f0181647d667d5b111097a2b236ac34502 /src | |
| parent | 2be1250f244a362b832cfc3d519a27363495f130 (diff) | |
| download | zig-df7db0c4beae6c491a4354a8fd10bf30b11c8e5d.tar.gz zig-df7db0c4beae6c491a4354a8fd10bf30b11c8e5d.zip | |
x86_64: pass behavior tests PIC and non-PIC
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 9db0f0a1dc..a467f285be 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -10013,7 +10013,7 @@ fn genCall(self: *Self, info: union(enum) { const sym = elf_file.symbol(sym_index); _ = try sym.getOrCreateZigGotEntry(sym_index, elf_file); if (self.bin_file.options.pic) { - try self.genSetReg(.rax, Type.usize, .{ .lea_symbol = sym.esym_index }); + try self.genSetReg(.rax, Type.usize, .{ .load_symbol = sym.esym_index }); try self.asmRegister(.{ ._, .call }, .rax); } else { _ = try self.addInst(.{ @@ -12766,7 +12766,7 @@ fn genLazySymbolRef( if (self.bin_file.options.pic) { switch (tag) { - .lea, .call => try self.genSetReg(reg, Type.usize, .{ .lea_symbol = sym.esym_index }), + .lea, .call => try self.genSetReg(reg, Type.usize, .{ .load_symbol = sym.esym_index }), .mov => try self.genSetReg(reg, Type.usize, .{ .load_symbol = sym.esym_index }), else => unreachable, } @@ -12782,7 +12782,7 @@ fn genLazySymbolRef( }; switch (tag) { .lea, .mov => _ = try self.addInst(.{ - .tag = tag, + .tag = .mov, .ops = .linker_reloc, .data = .{ .rx = .{ .r1 = reg.to64(), @@ -14686,7 +14686,6 @@ fn resolveInst(self: *Self, ref: Air.Inst.Ref) InnerError!MCValue { .ty = ty, .val = ip_index.toValue(), }); - std.debug.print("genTypedValue: {any}\n", .{mcv}); if (!gop.found_existing) gop.value_ptr.* = InstTracking.init(mcv); break :mcv gop.value_ptr.short; }; |
