elf: add simplistic reloc scanning mechanism

This commit is contained in:
Jakub Konka
2023-09-12 16:32:55 +02:00
parent c654f3b0ee
commit 44e84af874
7 changed files with 115 additions and 20 deletions

View File

@@ -856,6 +856,7 @@ fn genDeclRef(
if (bin_file.cast(link.File.Elf)) |elf_file| {
const sym_index = try elf_file.getOrCreateMetadataForDecl(decl_index);
const sym = elf_file.symbol(sym_index);
sym.flags.needs_got = true;
_ = try sym.getOrCreateGotEntry(elf_file);
return GenResult.mcv(.{ .memory = sym.gotAddress(elf_file) });
} else if (bin_file.cast(link.File.MachO)) |macho_file| {