| ... | @@ -755,7 +755,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { | ... | @@ -755,7 +755,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { |
| 755 | const out_file = try directory.handle.openFile(self.base.options.emit.?.sub_path, .{ .write = true }); | 755 | const out_file = try directory.handle.openFile(self.base.options.emit.?.sub_path, .{ .write = true }); |
| 756 | try self.parseFromFile(out_file); | 756 | try self.parseFromFile(out_file); |
| 757 | | 757 | |
| 758 | if (self.libsystem_cmd_index == null) { | 758 | if (self.libsystem_cmd_index == null and self.header.?.filetype == macho.MH_EXECUTE) { |
| 759 | const text_segment = self.load_commands.items[self.text_segment_cmd_index.?].Segment; | 759 | const text_segment = self.load_commands.items[self.text_segment_cmd_index.?].Segment; |
| 760 | const text_section = text_segment.sections.items[self.text_section_index.?]; | 760 | const text_section = text_segment.sections.items[self.text_section_index.?]; |
| 761 | const after_last_cmd_offset = self.header.?.sizeofcmds + @sizeOf(macho.mach_header_64); | 761 | const after_last_cmd_offset = self.header.?.sizeofcmds + @sizeOf(macho.mach_header_64); |
| ... | @@ -2039,10 +2039,8 @@ fn parseFromFile(self: *MachO, file: fs.File) !void { | ... | @@ -2039,10 +2039,8 @@ fn parseFromFile(self: *MachO, file: fs.File) !void { |
| 2039 | macho.LC_CODE_SIGNATURE => { | 2039 | macho.LC_CODE_SIGNATURE => { |
| 2040 | self.code_signature_cmd_index = i; | 2040 | self.code_signature_cmd_index = i; |
| 2041 | }, | 2041 | }, |
| 2042 | // TODO populate more MachO fields | | |
| 2043 | else => { | 2042 | else => { |
| 2044 | std.log.err("Unknown load command detected: 0x{x}.", .{cmd.cmd()}); | 2043 | std.log.warn("Unknown load command detected: 0x{x}.", .{cmd.cmd()}); |
| 2045 | return error.UnknownLoadCommand; | | |
| 2046 | }, | 2044 | }, |
| 2047 | } | 2045 | } |
| 2048 | self.load_commands.appendAssumeCapacity(cmd); | 2046 | self.load_commands.appendAssumeCapacity(cmd); |