diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2021-03-16 22:25:50 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2021-03-17 12:10:39 +0100 |
| commit | 3019676440c5ea30be8a9a185fb1346622f7cbdb (patch) | |
| tree | 35da96326b92fdec09219f49a252f59488c18d5e /src/codegen.zig | |
| parent | f76bd56588e556ea580c1faa63667cc9264cc218 (diff) | |
| download | zig-3019676440c5ea30be8a9a185fb1346622f7cbdb.tar.gz zig-3019676440c5ea30be8a9a185fb1346622f7cbdb.zip | |
macho: apply some renames to bring closer to zld
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index a508885576..04bb7741b7 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -2152,8 +2152,8 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { const decl = func_payload.data; const decl_name = try std.fmt.allocPrint(self.bin_file.allocator, "_{s}", .{decl.name}); defer self.bin_file.allocator.free(decl_name); - const already_defined = macho_file.extern_lazy_symbols.contains(decl_name); - const symbol: u32 = if (macho_file.extern_lazy_symbols.getIndex(decl_name)) |index| + const already_defined = macho_file.lazy_imports.contains(decl_name); + const symbol: u32 = if (macho_file.lazy_imports.getIndex(decl_name)) |index| @intCast(u32, index) else try macho_file.addExternSymbol(decl_name); @@ -3111,7 +3111,8 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { 4, 8 => { const offset = if (math.cast(i9, adj_off)) |imm| Instruction.LoadStoreOffset.imm_post_index(-imm) - else |_| Instruction.LoadStoreOffset.reg(try self.copyToTmpRegister(src, Type.initTag(.u64), MCValue{ .immediate = adj_off })); + else |_| + Instruction.LoadStoreOffset.reg(try self.copyToTmpRegister(src, Type.initTag(.u64), MCValue{ .immediate = adj_off })); const rn: Register = switch (arch) { .aarch64, .aarch64_be => .x29, .aarch64_32 => .w29, |
