elf: do not reserve a GOT slot for every Atom

This commit is contained in:
Jakub Konka
2023-04-18 14:04:42 +02:00
parent 528b66f6ec
commit 8a3ad3f620
8 changed files with 132 additions and 53 deletions

View File

@@ -1006,6 +1006,7 @@ fn genDeclRef(
if (bin_file.cast(link.File.Elf)) |elf_file| {
const atom_index = try elf_file.getOrCreateAtomForDecl(decl_index);
const atom = elf_file.getAtom(atom_index);
_ = try atom.getOrCreateOffsetTableEntry(elf_file);
return GenResult.mcv(.{ .memory = atom.getOffsetTableAddress(elf_file) });
} else if (bin_file.cast(link.File.MachO)) |macho_file| {
const atom_index = try macho_file.getOrCreateAtomForDecl(decl_index);