authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-09-07 16:10:19+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-09-07 22:42:59+02:00
log639237c7b4655d7d4c38c24d9b36a145bbfb1e1c
tree41d573d14c9a4add90941cce460803c50e4c05dd
parent8ef1c62f2efc4a43e8b38d3cacf4fd930add7f46

macho: set file instance in linkOneShot only if not already set


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

src/link/MachO.zig+7-5
...@@ -793,11 +793,13 @@ fn linkOneShot(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node)...@@ -793,11 +793,13 @@ fn linkOneShot(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node)
793 }793 }
794 } else {794 } else {
795 const sub_path = self.base.options.emit.?.sub_path;795 const sub_path = self.base.options.emit.?.sub_path;
796 self.base.file = try directory.handle.createFile(sub_path, .{796 if (self.base.file == null) {
797 .truncate = true,797 self.base.file = try directory.handle.createFile(sub_path, .{
798 .read = true,798 .truncate = true,
799 .mode = link.determineMode(self.base.options),799 .read = true,
800 });800 .mode = link.determineMode(self.base.options),
801 });
802 }
801 // Index 0 is always a null symbol.803 // Index 0 is always a null symbol.
802 try self.locals.append(gpa, .{804 try self.locals.append(gpa, .{
803 .n_strx = 0,805 .n_strx = 0,