aboutsummaryrefslogtreecommitdiff
path: root/src/arch/aarch64/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-06-16 21:57:33 -0700
committerGitHub <noreply@github.com>2023-06-16 21:57:33 -0700
commit78c8cb4225c3c3d429764151ad703a4bfa67d75a (patch)
tree8352b61ff54c133f78e4b8d1e05714561ee105bb /src/arch/aarch64/CodeGen.zig
parent0f5aff34414bcb024443540fe905039f3783803a (diff)
parent5343a2f566a5c235055f4aebb4ab9c10773e57f0 (diff)
downloadzig-78c8cb4225c3c3d429764151ad703a4bfa67d75a.tar.gz
zig-78c8cb4225c3c3d429764151ad703a4bfa67d75a.zip
Merge pull request #16003 from g-w1/plan9-lazy-syms
Plan9: lots of fixes
Diffstat (limited to 'src/arch/aarch64/CodeGen.zig')
-rw-r--r--src/arch/aarch64/CodeGen.zig11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/arch/aarch64/CodeGen.zig b/src/arch/aarch64/CodeGen.zig
index bf945e6983..dd752555b7 100644
--- a/src/arch/aarch64/CodeGen.zig
+++ b/src/arch/aarch64/CodeGen.zig
@@ -4335,14 +4335,9 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
},
});
} else if (self.bin_file.cast(link.File.Plan9)) |p9| {
- const decl_block_index = try p9.seeDecl(func.owner_decl);
- const decl_block = p9.getDeclBlock(decl_block_index);
- const ptr_bits = self.target.ptrBitWidth();
- const ptr_bytes: u64 = @divExact(ptr_bits, 8);
- const got_addr = p9.bases.data;
- const got_index = decl_block.got_index.?;
- const fn_got_addr = got_addr + got_index * ptr_bytes;
- try self.genSetReg(Type.usize, .x30, .{ .memory = fn_got_addr });
+ const atom_index = try p9.seeDecl(func.owner_decl);
+ const atom = p9.getAtom(atom_index);
+ try self.genSetReg(Type.usize, .x30, .{ .memory = atom.getOffsetTableAddress(p9) });
} else unreachable;
_ = try self.addInst(.{