diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-30 00:09:32 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-30 00:09:32 +0100 |
| commit | 2e690f5c74cbfd16757cc301ac0d899caa8b2fb3 (patch) | |
| tree | ad622a039430932b24f69d968d73c3e4fb8c8ed8 /src/arch/x86_64/CodeGen.zig | |
| parent | 71dfea1f174b0531139e33e8aa4fe86ccd9f23dd (diff) | |
| download | zig-2e690f5c74cbfd16757cc301ac0d899caa8b2fb3.tar.gz zig-2e690f5c74cbfd16757cc301ac0d899caa8b2fb3.zip | |
macho: implement enough of extern handling to pass comptime export tests
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 18011fc054..d6ac3fb36b 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -13080,12 +13080,13 @@ fn genExternSymbolRef( else => unreachable, } } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { + const global_index = try macho_file.getGlobalSymbol(callee, lib); _ = try self.addInst(.{ .tag = .call, .ops = .extern_fn_reloc, .data = .{ .reloc = .{ .atom_index = atom_index, - .sym_index = try macho_file.getGlobalSymbol(callee, lib), + .sym_index = link.File.MachO.global_symbol_bit | global_index, } }, }); } else return self.fail("TODO implement calling extern functions", .{}); |
