| ... | @@ -1157,6 +1157,18 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void { | ... | @@ -1157,6 +1157,18 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void { |
| 1157 | .length = 2, | 1157 | .length = 2, |
| 1158 | .@"type" = @enumToInt(std.macho.reloc_type_x86_64.X86_64_RELOC_BRANCH), | 1158 | .@"type" = @enumToInt(std.macho.reloc_type_x86_64.X86_64_RELOC_BRANCH), |
| 1159 | }); | 1159 | }); |
| | 1160 | } else if (emit.bin_file.cast(link.File.Coff)) |coff_file| { |
| | 1161 | // Add relocation to the decl. |
| | 1162 | const atom = coff_file.atom_by_index_table.get(relocation.atom_index).?; |
| | 1163 | try atom.addRelocation(coff_file, .{ |
| | 1164 | .@"type" = .direct, |
| | 1165 | .target = .{ .sym_index = relocation.sym_index, .file = null }, |
| | 1166 | .offset = offset, |
| | 1167 | .addend = 0, |
| | 1168 | .pcrel = true, |
| | 1169 | .length = 2, |
| | 1170 | .prev_vaddr = atom.getSymbol(coff_file).value, |
| | 1171 | }); |
| 1160 | } else { | 1172 | } else { |
| 1161 | return emit.fail("TODO implement call_extern for linking backends different than MachO", .{}); | 1173 | return emit.fail("TODO implement call_extern for linking backends different than MachO", .{}); |
| 1162 | } | 1174 | } |