diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2024-07-14 07:11:12 +0200 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2024-07-18 09:13:08 +0200 |
| commit | 234aa86802ececa8450d84e4cb16da7ce8a5cf79 (patch) | |
| tree | e50da8eac21009e8a70683b978dd2312e9694c12 | |
| parent | 387a71fa5bed4782d6f6789b8ca1ce637a31076f (diff) | |
| download | zig-234aa86802ececa8450d84e4cb16da7ce8a5cf79.tar.gz zig-234aa86802ececa8450d84e4cb16da7ce8a5cf79.zip | |
macho: update non-incremental section sizes for ZigObject sections
| -rw-r--r-- | src/link/MachO.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 3c02900589..bb1a9a064e 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -1843,6 +1843,15 @@ pub fn addAtomsToSections(self: *MachO) !void { const gpa = self.base.comp.gpa; + if (self.getZigObject()) |zo| { + for (zo.getAtoms()) |atom_index| { + const atom = zo.getAtom(atom_index) orelse continue; + if (!atom.flags.alive) continue; + if (self.isZigSection(atom.out_n_sect)) continue; + const atoms = &self.sections.items(.atoms)[atom.out_n_sect]; + try atoms.append(gpa, .{ .index = atom_index, .file = zo.index }); + } + } for (self.objects.items) |index| { const file = self.getFile(index).?; for (file.getAtoms()) |atom_index| { |
