Skip to content

Commit

Permalink
macho: -weak-lx taints each import as weak-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Nov 22, 2023
1 parent 865af1e commit efbc74e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MachO/Symbol.zig
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ pub fn setOutputSym(symbol: Symbol, macho_file: *MachO, out: *macho.nlist_64) vo
out.n_sect = 0;
out.n_value = 0;
out.n_desc = @as(u16, @bitCast(symbol.getDylibOrdinal(macho_file))) * macho.N_SYMBOL_RESOLVER;

if (symbol.getFile(macho_file)) |file| switch (file) {
.dylib => |x| if (x.weak) {
out.n_desc |= macho.N_WEAK_REF;
},
else => {},
};
}
}

Expand Down

0 comments on commit efbc74e

Please sign in to comment.