[lld-macho] Implement -load_hidden
authorDaniel Bertalan <dani@danielbertalan.dev>
Mon, 25 Jul 2022 09:45:55 +0000 (11:45 +0200)
committerDaniel Bertalan <dani@danielbertalan.dev>
Mon, 25 Jul 2022 18:59:33 +0000 (20:59 +0200)
commit4c79e1a3f4eb790f40239833ae237e828ce07386
tree5d82292064a8765f47ec467088d60289ef2ebc49
parentf04ae43752a014fde8d6db6dc248044b0d02976a
[lld-macho] Implement -load_hidden

This flag was introduced in ld64-609. It instructs the linker to link to
a static library while treating its symbols as if they had hidden
visibility. This is useful when building a dylib that links to static
libraries but we don't want the symbols from those to be exported.

Closes #51505

Differential Revision: https://reviews.llvm.org/D130473
lld/MachO/Driver.cpp
lld/MachO/DriverUtils.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/Options.td
lld/test/MachO/load-hidden.s [new file with mode: 0644]
lld/test/MachO/reroot-path.s