| ... | @@ -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, |