Skip to content

Commit

Permalink
macho: calc compact unwind info size only if present
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Jul 12, 2024
1 parent 020cb4d commit e4e6ec8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/MachO/relocatable.zig
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,24 @@ fn calcSectionSizes(macho_file: *MachO) !void {
macho_file.base.thread_pool.spawnWg(&wg, calcEhFrameSizeWorker, .{macho_file});
}

for (macho_file.objects.items) |index| {
if (macho_file.unwind_info_sect_index) |_| {
if (macho_file.unwind_info_sect_index) |_| {
for (macho_file.objects.items) |index| {
macho_file.base.thread_pool.spawnWg(&wg, Object.calcCompactUnwindSizeRelocatable, .{
macho_file.getFile(index).?.object,
macho_file,
});
}

}
for (macho_file.objects.items) |index| {
macho_file.base.thread_pool.spawnWg(&wg, File.calcSymtabSize, .{ macho_file.getFile(index).?, macho_file });
}

macho_file.base.thread_pool.spawnWg(&wg, MachO.updateLinkeditSizeWorker, .{ macho_file, .data_in_code });
}

calcCompactUnwindSize(macho_file);
if (macho_file.unwind_info_sect_index) |_| {
calcCompactUnwindSize(macho_file);
}
calcSymtabSize(macho_file);

if (macho_file.has_errors.swap(false, .seq_cst)) return error.FlushFailed;
Expand Down

0 comments on commit e4e6ec8

Please sign in to comment.