Commit ecd480fe93
Changed files (1)
src
link
src/link/MachO.zig
@@ -367,8 +367,6 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
.Lib => return error.TODOImplementWritingLibFiles,
}
- if (self.cmd_table_dirty) try self.writeCmdHeaders();
-
{
// Update symbol table.
const nlocals = @intCast(u32, self.local_symbols.items.len);
@@ -378,6 +376,8 @@ pub fn flushModule(self: *MachO, comp: *Compilation) !void {
symtab.nsyms = nlocals + nglobals + nundefs;
}
+ if (self.cmd_table_dirty) try self.writeCmdHeaders();
+
if (self.entry_addr == null and self.base.options.output_mode == .Exe) {
log.debug("flushing. no_entry_point_found = true\n", .{});
self.error_flags.no_entry_point_found = true;