diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-12-09 16:21:48 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-12-09 21:12:38 +0100 |
| commit | f7fea080b25f932b352d38f126e0a179c5163f68 (patch) | |
| tree | c7e7e528c0fada33646129533b9b8ce4f3380383 /src/link/MachO | |
| parent | bd5a8f86a120093b126cfbde41e002dae161e883 (diff) | |
| download | zig-f7fea080b25f932b352d38f126e0a179c5163f68.tar.gz zig-f7fea080b25f932b352d38f126e0a179c5163f68.zip | |
macho+zld: skip atomless synthetic globals in dead_strip
They are implicitly marked live.
Diffstat (limited to 'src/link/MachO')
| -rw-r--r-- | src/link/MachO/dead_strip.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/link/MachO/dead_strip.zig b/src/link/MachO/dead_strip.zig index aee03bb1d9..ab36ef8a76 100644 --- a/src/link/MachO/dead_strip.zig +++ b/src/link/MachO/dead_strip.zig @@ -58,7 +58,8 @@ fn collectRoots(zld: *Zld, roots: *AtomTable) !void { const sym = zld.getSymbol(global); if (sym.undf()) continue; - const object = zld.objects.items[global.getFile().?]; + const file = global.getFile() orelse continue; // synthetic globals are atomless + const object = zld.objects.items[file]; const atom_index = object.getAtomIndexForSymbol(global.sym_index).?; // panic here means fatal error _ = try roots.getOrPut(atom_index); |
