From 5343a2f566a5c235055f4aebb4ab9c10773e57f0 Mon Sep 17 00:00:00 2001 From: Jacob G-W Date: Wed, 14 Jun 2023 15:43:46 -0400 Subject: plan9: revamp the relocation system to allow decl refs --- src/codegen.zig | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/codegen.zig') diff --git a/src/codegen.zig b/src/codegen.zig index 7625fbe031..d446200a3b 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -879,12 +879,9 @@ fn genUnnamedConst( return GenResult.mcv(.{ .load_direct = local_sym_index }); } else if (bin_file.cast(link.File.Coff)) |_| { return GenResult.mcv(.{ .load_direct = local_sym_index }); - } else if (bin_file.cast(link.File.Plan9)) |p9| { - const ptr_bits = target.ptrBitWidth(); - const ptr_bytes: u64 = @divExact(ptr_bits, 8); - const got_index = local_sym_index; // the plan9 backend returns the got_index - const got_addr = p9.bases.data + got_index * ptr_bytes; - return GenResult.mcv(.{ .memory = got_addr }); + } else if (bin_file.cast(link.File.Plan9)) |_| { + const atom_index = local_sym_index; // plan9 returns the atom_index + return GenResult.mcv(.{ .load_direct = atom_index }); } else { return GenResult.fail(bin_file.allocator, src_loc, "TODO genUnnamedConst for target {}", .{target}); } -- cgit v1.2.3