macho: generate stabs last to aid in deterministic uuid calculation

This commit is contained in:
Jakub Konka
2022-12-15 11:25:54 +01:00
parent 6b99aab0eb
commit 3af6a4e887

View File

@@ -2556,12 +2556,6 @@ pub const Zld = struct {
}
}
if (!self.options.strip) {
for (self.objects.items) |object| {
try self.generateSymbolStabs(object, &locals);
}
}
var exports = std.ArrayList(macho.nlist_64).init(gpa);
defer exports.deinit();
@@ -2592,6 +2586,14 @@ pub const Zld = struct {
try imports_table.putNoClobber(global, new_index);
}
// We generate stabs last in order to ensure that the strtab always has debug info
// strings trailing
if (!self.options.strip) {
for (self.objects.items) |object| {
try self.generateSymbolStabs(object, &locals);
}
}
const nlocals = @intCast(u32, locals.items.len);
const nexports = @intCast(u32, exports.items.len);
const nimports = @intCast(u32, imports.items.len);