| ... | ... | @@ -369,6 +369,11 @@ fn calcSectionSizes(macho_file: *MachO) !void { |
| 369 | 369 | calcSectionSize(macho_file, @intCast(i)); |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | if (macho_file.getZigObject()) |zo| { |
| 373 | // TODO this will create a race |
| 374 | zo.calcNumRelocs(macho_file); |
| 375 | } |
| 376 | |
| 372 | 377 | if (macho_file.eh_frame_sect_index) |_| { |
| 373 | 378 | try calcEhFrameSize(macho_file); |
| 374 | 379 | } |
| ... | ... | @@ -382,19 +387,10 @@ fn calcSectionSizes(macho_file: *MachO) !void { |
| 382 | 387 | |
| 383 | 388 | try macho_file.data_in_code.updateSize(macho_file); |
| 384 | 389 | |
| 385 | | calcCompactUnwindSize(macho_file); |
| 390 | if (macho_file.unwind_info_sect_index) |_| { |
| 391 | calcCompactUnwindSize(macho_file); |
| 392 | } |
| 386 | 393 | calcSymtabSize(macho_file); |
| 387 | | |
| 388 | | // TODO |
| 389 | | // if (macho_file.getZigObject()) |zo| { |
| 390 | | // for (zo.atoms.items) |atom_index| { |
| 391 | | // const atom = macho_file.getAtom(atom_index) orelse continue; |
| 392 | | // if (!atom.flags.alive) continue; |
| 393 | | // const header = &macho_file.sections.items(.header)[atom.out_n_sect]; |
| 394 | | // if (!macho_file.isZigSection(atom.out_n_sect) and !macho_file.isDebugSection(atom.out_n_sect)) continue; |
| 395 | | // header.nreloc += atom.calcNumRelocs(macho_file); |
| 396 | | // } |
| 397 | | // } |
| 398 | 394 | } |
| 399 | 395 | |
| 400 | 396 | fn calcSectionSize(macho_file: *MachO, sect_id: u8) void { |