| author | |
| committer | |
| log | 5823f19c5e86e42b82240756ee9ffad536359c4b |
| tree | 87705ac2fddf8e3f4463cebbf26ea4b482758a78 |
| parent | 2c2ff4558f83cdf1aacb0a4865389e93af60d2d5 |
2 files changed, 5 insertions(+), 3 deletions(-)
src/link/MachO/Object.zig+3-2| ... | ... | @@ -515,8 +515,9 @@ pub fn getSourceSymbol(self: Object, index: u32) ?macho.nlist_64 { |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /// Caller owns memory. |
| 518 | pub fn createReverseSymbolLookup(self: Object, gpa: Allocator) ![]u32 { | |
| 519 | const lookup = try gpa.alloc(u32, self.in_symtab.?.len); | |
| 518 | pub fn createReverseSymbolLookup(self: Object, arena: Allocator) ![]u32 { | |
| 519 | const symtab = self.in_symtab orelse return &[0]u32{}; | |
| 520 | const lookup = try arena.alloc(u32, symtab.len); | |
| 520 | 521 | for (self.source_symtab_lookup) |source_id, id| { |
| 521 | 522 | lookup[source_id] = @intCast(u32, id); |
| 522 | 523 | } |
src/link/MachO/zld.zig+2-1| ... | ... | @@ -3486,6 +3486,7 @@ pub const Zld = struct { |
| 3486 | 3486 | scoped_log.debug("locals:", .{}); |
| 3487 | 3487 | for (self.objects.items) |object, id| { |
| 3488 | 3488 | scoped_log.debug(" object({d}): {s}", .{ id, object.name }); |
| 3489 | if (object.in_symtab == null) continue; | |
| 3489 | 3490 | for (object.symtab) |sym, sym_id| { |
| 3490 | 3491 | mem.set(u8, &buf, '_'); |
| 3491 | 3492 | scoped_log.debug(" %{d}: {s} @{x} in sect({d}), {s}", .{ |
| ... | ... | @@ -3641,7 +3642,7 @@ pub const Zld = struct { |
| 3641 | 3642 | sym.n_sect, |
| 3642 | 3643 | }); |
| 3643 | 3644 | |
| 3644 | if (atom.getFile() != null) { | |
| 3645 | if (atom.getFile() != null) { | |
| 3645 | 3646 | var it = Atom.getInnerSymbolsIterator(self, atom_index); |
| 3646 | 3647 | while (it.next()) |sym_loc| { |
| 3647 | 3648 | const inner = self.getSymbol(sym_loc); |