| ... | @@ -1,10 +1,10 @@ | ... | @@ -1,10 +1,10 @@ |
| 1 | pub fn gcAtoms(macho_file: *MachO) !void { | 1 | pub fn gcAtoms(macho_file: *MachO) !void { |
| 2 | const gpa = macho_file.base.allocator; | 2 | const gpa = macho_file.base.comp.gpa; |
| 3 | | 3 | |
| 4 | var objects = try std.ArrayList(File.Index).initCapacity(gpa, macho_file.objects.items.len + 1); | 4 | var objects = try std.ArrayList(File.Index).initCapacity(gpa, macho_file.objects.items.len + 1); |
| 5 | defer objects.deinit(); | 5 | defer objects.deinit(); |
| 6 | for (macho_file.objects.items) |index| objects.appendAssumeCapacity(index); | 6 | for (macho_file.objects.items) |index| objects.appendAssumeCapacity(index); |
| 7 | if (macho_file.internal_object_index) |index| objects.appendAssumeCapacity(index); | 7 | if (macho_file.internal_object) |index| objects.appendAssumeCapacity(index); |
| 8 | | 8 | |
| 9 | var roots = std.ArrayList(*Atom).init(gpa); | 9 | var roots = std.ArrayList(*Atom).init(gpa); |
| 10 | defer roots.deinit(); | 10 | defer roots.deinit(); |
| ... | @@ -21,7 +21,7 @@ fn collectRoots(roots: *std.ArrayList(*Atom), objects: []const File.Index, macho | ... | @@ -21,7 +21,7 @@ fn collectRoots(roots: *std.ArrayList(*Atom), objects: []const File.Index, macho |
| 21 | const sym = macho_file.getSymbol(sym_index); | 21 | const sym = macho_file.getSymbol(sym_index); |
| 22 | const file = sym.getFile(macho_file) orelse continue; | 22 | const file = sym.getFile(macho_file) orelse continue; |
| 23 | if (file.getIndex() != index) continue; | 23 | if (file.getIndex() != index) continue; |
| 24 | if (sym.flags.no_dead_strip or (macho_file.options.dylib and sym.visibility == .global)) | 24 | if (sym.flags.no_dead_strip or (macho_file.base.isDynLib() and sym.visibility == .global)) |
| 25 | try markSymbol(sym, roots, macho_file); | 25 | try markSymbol(sym, roots, macho_file); |
| 26 | } | 26 | } |
| 27 | | 27 | |