| ... | @@ -1843,6 +1843,15 @@ pub fn addAtomsToSections(self: *MachO) !void { | ... | @@ -1843,6 +1843,15 @@ pub fn addAtomsToSections(self: *MachO) !void { |
| 1843 | | 1843 | |
| 1844 | const gpa = self.base.comp.gpa; | 1844 | const gpa = self.base.comp.gpa; |
| 1845 | | 1845 | |
| | 1846 | if (self.getZigObject()) |zo| { |
| | 1847 | for (zo.getAtoms()) |atom_index| { |
| | 1848 | const atom = zo.getAtom(atom_index) orelse continue; |
| | 1849 | if (!atom.flags.alive) continue; |
| | 1850 | if (self.isZigSection(atom.out_n_sect)) continue; |
| | 1851 | const atoms = &self.sections.items(.atoms)[atom.out_n_sect]; |
| | 1852 | try atoms.append(gpa, .{ .index = atom_index, .file = zo.index }); |
| | 1853 | } |
| | 1854 | } |
| 1846 | for (self.objects.items) |index| { | 1855 | for (self.objects.items) |index| { |
| 1847 | const file = self.getFile(index).?; | 1856 | const file = self.getFile(index).?; |
| 1848 | for (file.getAtoms()) |atom_index| { | 1857 | for (file.getAtoms()) |atom_index| { |