| ... | @@ -2556,12 +2556,6 @@ pub const Zld = struct { | ... | @@ -2556,12 +2556,6 @@ pub const Zld = struct { |
| 2556 | } | 2556 | } |
| 2557 | } | 2557 | } |
| 2558 | | 2558 | |
| 2559 | if (!self.options.strip) { | | |
| 2560 | for (self.objects.items) |object| { | | |
| 2561 | try self.generateSymbolStabs(object, &locals); | | |
| 2562 | } | | |
| 2563 | } | | |
| 2564 | | | |
| 2565 | var exports = std.ArrayList(macho.nlist_64).init(gpa); | 2559 | var exports = std.ArrayList(macho.nlist_64).init(gpa); |
| 2566 | defer exports.deinit(); | 2560 | defer exports.deinit(); |
| 2567 | | 2561 | |
| ... | @@ -2592,6 +2586,14 @@ pub const Zld = struct { | ... | @@ -2592,6 +2586,14 @@ pub const Zld = struct { |
| 2592 | try imports_table.putNoClobber(global, new_index); | 2586 | try imports_table.putNoClobber(global, new_index); |
| 2593 | } | 2587 | } |
| 2594 | | 2588 | |
| | 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 | |
| 2595 | const nlocals = @intCast(u32, locals.items.len); | 2597 | const nlocals = @intCast(u32, locals.items.len); |
| 2596 | const nexports = @intCast(u32, exports.items.len); | 2598 | const nexports = @intCast(u32, exports.items.len); |
| 2597 | const nimports = @intCast(u32, imports.items.len); | 2599 | const nimports = @intCast(u32, imports.items.len); |