aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-10-11 00:38:23 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-10-13 08:38:17 +0200
commitecd480fe93b7ee1882267bed6efbfcfe45402ab6 (patch)
treeab3210fc0430770edb5c7b2001769b6f4bcd22a8 /src
parentfc660af07774887df8a5ed479cb7c2c662b173ce (diff)
downloadzig-ecd480fe93b7ee1882267bed6efbfcfe45402ab6.tar.gz
zig-ecd480fe93b7ee1882267bed6efbfcfe45402ab6.zip
Fix writing of load cmds headers *after* symtab update
Diffstat (limited to 'src')
-rw-r--r--src/link/MachO.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index b2e81916f6..e87488974c 100644
--- a/src/link/MachO.zig
+++ b/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;