From 5b5466626810302371b2d21c39e7ad04ea13a8dc Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Mon, 20 Mar 2023 16:12:51 +0100 Subject: [PATCH] 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. --- src/link/MachO/dead_strip.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/link/MachO/dead_strip.zig b/src/link/MachO/dead_strip.zig index 9dfd6226b4..a132ecb2de 100644 --- a/src/link/MachO/dead_strip.zig +++ b/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,