aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2024-08-12 22:04:18 +0200
committerJakub Konka <kubkon@jakubkonka.com>2024-08-13 13:30:24 +0200
commit16abf51ceef2ba2ebb38f27270af676387435f05 (patch)
tree868f8623a5a8fb8f01b99f0bdc60044b4cf55704 /src/codegen.zig
parentf968dd0cb1fc9197fc6483ce235b037f6c86c8ce (diff)
downloadzig-16abf51ceef2ba2ebb38f27270af676387435f05.tar.gz
zig-16abf51ceef2ba2ebb38f27270af676387435f05.zip
x86_64: handle lea_symbol returned by genNavRef
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index f2fa60fdf8..679ee03c27 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -828,6 +828,9 @@ pub const GenResult = union(enum) {
/// Reference to memory location but deferred until linker allocated the Decl in memory.
/// Traditionally, this corresponds to emitting a relocation in a relocatable object file.
load_symbol: u32,
+ /// Reference to memory location but deferred until linker allocated the Decl in memory.
+ /// Traditionally, this corresponds to emitting a relocation in a relocatable object file.
+ lea_symbol: u32,
};
fn mcv(val: MCValue) GenResult {
@@ -904,7 +907,7 @@ fn genNavRef(
if (!single_threaded and is_threadlocal) {
return GenResult.mcv(.{ .load_tlv = sym_index });
}
- return GenResult.mcv(.{ .load_symbol = sym_index });
+ return GenResult.mcv(.{ .lea_symbol = sym_index });
} else if (lf.cast(.macho)) |macho_file| {
const zo = macho_file.getZigObject().?;
if (is_extern) {