[all-commits] [llvm/llvm-project] 6e05c1: [lld/mac] Always reference dyld_stub_binder when l...
Nico Weber via All-commits
all-commits at lists.llvm.org
Sun Jul 11 10:38:09 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6e05c1cd5f98350520147d932efc853f2638ce25
https://github.com/llvm/llvm-project/commit/6e05c1cd5f98350520147d932efc853f2638ce25
Author: Nico Weber <thakis at chromium.org>
Date: 2021-07-11 (Sun, 11 Jul 2021)
Changed paths:
M lld/MachO/Driver.cpp
M lld/test/MachO/dyld-stub-binder.s
M lld/test/MachO/lto-internalize.ll
M lld/test/MachO/stabs.s
Log Message:
-----------
[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
More information about the All-commits
mailing list