authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-15 11:25:54+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-16 18:05:58+01:00
log3af6a4e887bb3cd986a52ea94202a0079f442e9b
tree113f2bfc12f5430409a6a4273b1ad39439db4313
parent6b99aab0eb25821d91c1708575cabdadc9079024

macho: generate stabs last to aid in deterministic uuid calculation


1 files changed, 8 insertions(+), 6 deletions(-)

src/link/MachO/zld.zig+8-6
......@@ -2556,12 +2556,6 @@ pub const Zld = struct {
25562556 }
25572557 }
25582558
2559 if (!self.options.strip) {
2560 for (self.objects.items) |object| {
2561 try self.generateSymbolStabs(object, &locals);
2562 }
2563 }
2564
25652559 var exports = std.ArrayList(macho.nlist_64).init(gpa);
25662560 defer exports.deinit();
25672561
......@@ -2592,6 +2586,14 @@ pub const Zld = struct {
25922586 try imports_table.putNoClobber(global, new_index);
25932587 }
25942588
2589 // We generate stabs last in order to ensure that the strtab always has debug info
2590 // strings trailing
2591 if (!self.options.strip) {
2592 for (self.objects.items) |object| {
2593 try self.generateSymbolStabs(object, &locals);
2594 }
2595 }
2596
25952597 const nlocals = @intCast(u32, locals.items.len);
25962598 const nexports = @intCast(u32, exports.items.len);
25972599 const nimports = @intCast(u32, imports.items.len);