macho: simplify symbol management and resolution

instead of globally storing unresolved and tentative defs,
store indices to actual symbols in the functions that are responsible
for symbol resolution.
This commit is contained in:
Jakub Konka
2021-08-03 13:37:48 +02:00
parent 493822ac3b
commit da57d6df32
3 changed files with 137 additions and 149 deletions

View File

@@ -2714,7 +2714,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
// Add relocation to the decl.
try macho_file.active_decl.?.link.macho.relocs.append(self.bin_file.allocator, .{
.offset = offset,
.where = .import,
.where = .undef,
.where_index = where_index,
.payload = .{ .branch = .{
.arch = arch,