Commit 5b54666268

Jakub Konka <kubkon@jakubkonka.com>
2023-03-20 16:12:51
macho+zld: relax assumption about dead strip atoms uniqueness
In case the compiler outputted an object file that is not slicable into subsections, entry point may overlap with a section atom which is perfectly fine, so don't panic in that case.
1 parent 9a203fa
Changed files (1)
src
link
src/link/MachO/dead_strip.zig
@@ -102,7 +102,7 @@ fn collectRoots(zld: *Zld, roots: *AtomTable) !void {
             };
 
             if (is_gc_root) {
-                try roots.putNoClobber(atom_index, {});
+                _ = try roots.getOrPut(atom_index);
 
                 log.debug("root(ATOM({d}, %{d}, {?d}))", .{
                     atom_index,