authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-03-22 15:13:52+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-03-22 15:13:52+01:00
log1eb4264b7aa9e9e2b8ec46a95b508dfa7a7ab0f7
treed17ba527664b37c1546c8abdbc218e7fa4aa9e14
parentc984201ddb10d2977290c6f1d6857e78573a2dff

macho+zld: make sure we populate source section index lookup if no undefs


1 files changed, 6 insertions(+), 0 deletions(-)

src/link/MachO/Object.zig+6
......@@ -239,6 +239,12 @@ pub fn parse(self: *Object, allocator: Allocator, cpu_arch: std.Target.Cpu.Arch)
239239 self.strtab_lookup[i] = @intCast(u32, sym_name_len);
240240 }
241241
242 // If there were no undefined symbols, make sure we populate the
243 // source section index lookup for the last scanned section.
244 if (section_index_lookup) |lookup| {
245 self.source_section_index_lookup[prev_sect_id - 1] = lookup;
246 }
247
242248 // Parse __TEXT,__eh_frame header if one exists
243249 self.eh_frame_sect_id = self.getSourceSectionIndexByName("__TEXT", "__eh_frame");
244250