mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 03:53:20 +00:00
macho+zld: skip atomless synthetic globals in dead_strip
They are implicitly marked live.
This commit is contained in:
parent
bd5a8f86a1
commit
f7fea080b2
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user