[lld/mac] Always reference dyld_stub_binder when linked with libSystem
lld currently only references dyld_stub_binder when it's needed. ld64 always references it when libSystem is linked. Match ld64. The (somewhat lame) motivation is that `nm` on a binary without any export writes a "no symbols" warning to stderr, and this change makes it so that every binary in practice has at least a reference to dyld_stub_binder, which suppresses that. Every "real" output file will reference dyld_stub_binder, so most of the time this shouldn't make much of a difference. And if you really don't want to have this reference for whatever reason, you can stop passing -lSystem, like you have to for ld64 anyways. (After linking any dylib, we dump the exported list of symbols to a txt file with `nm` and only relink downstream deps if that txt file changes. A nicer fix is to make lld optionally write .tbd files with the public interface of a linked dylib and use that instead, but for now the txt files are what we do.) Differential Revision: https://reviews.llvm.org/D105782
Loading
Please sign in to comment