authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-15 08:05:07+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-07-18 09:13:08+02:00
log521933e1c05977105ee4eee70096a13064068f8b
tree852278a7b668224cfa1851d5bfd3d7ca19d1dcb5
parentf9fbd6302f0f4d1ef5ed1c1d2fc63eabb313978d

macho: do not randomly append non-incr atoms in ZigObject


1 files changed, 1 insertions(+), 5 deletions(-)

src/link/MachO/ZigObject.zig+1-5
......@@ -497,6 +497,7 @@ pub fn writeAtomsRelocatable(self: *ZigObject, macho_file: *MachO) !void {
497497 const sect = atom.getInputSection(macho_file);
498498 if (sect.isZerofill()) continue;
499499 if (macho_file.isZigSection(atom.out_n_sect)) continue;
500 if (atom.getRelocs(macho_file).len == 0) continue;
500501 const off = atom.value;
501502 const buffer = macho_file.sections.items(.out)[atom.out_n_sect].items;
502503 try self.getAtomData(macho_file, atom.*, buffer[off..][0..atom.size]);
......@@ -1175,11 +1176,6 @@ fn createTlvDescriptor(
11751176 .symbolnum = @intCast(init_sym_index),
11761177 },
11771178 });
1178
1179 try macho_file.sections.items(.atoms)[sect_index].append(gpa, .{
1180 .index = atom.atom_index,
1181 .file = self.index,
1182 });
11831179}
11841180
11851181fn getDeclOutputSection(