elf: postpone creation of .got.zig entry until code emit

This commit is contained in:
Jakub Konka
2023-11-02 12:46:37 +01:00
parent 5affd29b47
commit ccb2afacc0
5 changed files with 14 additions and 12 deletions

View File

@@ -909,7 +909,7 @@ fn genDeclRef(
}
const sym_index = try elf_file.zigObjectPtr().?.getOrCreateMetadataForDecl(elf_file, decl_index);
const sym = elf_file.symbol(sym_index);
try sym.createZigGotEntry(sym_index, elf_file);
sym.flags.needs_zig_got = true;
return GenResult.mcv(.{ .load_symbol = sym.esym_index });
} else if (bin_file.cast(link.File.MachO)) |macho_file| {
if (is_extern) {