| ... | ... | @@ -4001,7 +4001,10 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier |
| 4001 | 4001 | const atom_index = try elf_file.getOrCreateAtomForDecl(func.owner_decl); |
| 4002 | 4002 | const atom = elf_file.getAtom(atom_index); |
| 4003 | 4003 | const got_addr = atom.getOffsetTableAddress(elf_file); |
| 4004 | | try self.asmImmediate(.call, Immediate.s(@intCast(i32, got_addr))); |
| 4004 | try self.asmMemory(.call, Memory.sib(.qword, .{ |
| 4005 | .base = .ds, |
| 4006 | .disp = @intCast(i32, got_addr), |
| 4007 | })); |
| 4005 | 4008 | } else if (self.bin_file.cast(link.File.Coff)) |coff_file| { |
| 4006 | 4009 | const atom_index = try coff_file.getOrCreateAtomForDecl(func.owner_decl); |
| 4007 | 4010 | const sym_index = coff_file.getAtom(atom_index).getSymbolIndex().?; |
| ... | ... | @@ -4030,7 +4033,10 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier |
| 4030 | 4033 | const got_addr = p9.bases.data; |
| 4031 | 4034 | const got_index = decl_block.got_index.?; |
| 4032 | 4035 | const fn_got_addr = got_addr + got_index * ptr_bytes; |
| 4033 | | try self.asmImmediate(.call, Immediate.s(@intCast(i32, fn_got_addr))); |
| 4036 | try self.asmMemory(.call, Memory.sib(.qword, .{ |
| 4037 | .base = .ds, |
| 4038 | .disp = @intCast(i32, fn_got_addr), |
| 4039 | })); |
| 4034 | 4040 | } else unreachable; |
| 4035 | 4041 | } else if (func_value.castTag(.extern_fn)) |func_payload| { |
| 4036 | 4042 | const extern_fn = func_payload.data; |