[lld][MachO] Respect dylibs linked with `-allowable_client` (#114638)
commit1de9bc1a27137a7559a247b73c14cfab3be81b54
authorCarlo Cabrera <github@carlo.cab>
Thu, 21 Nov 2024 01:02:17 +0000 (21 09:02 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Nov 2024 01:02:17 +0000 (20 20:02 -0500)
treebd1cfa743bdd07955965f4fbe45b931de89ebd11
parentfe33bd0617ef4905ad144566bb26b1e177875e1a
[lld][MachO] Respect dylibs linked with `-allowable_client` (#114638)

ld64.lld would previously allow you to link against dylibs linked with
`-allowable_client`, even if the client's name does not match any
allowed client.

This change fixes that. See #114146 for related discussion.

The test binary `liballowable_client.dylib` was created on macOS with:

echo | clang -xc - -dynamiclib -mmacosx-version-min=10.11 -arch x86_64
-Wl,-allowable_client,allowed -o lib/liballowable_client.dylib
lld/MachO/Config.h
lld/MachO/Driver.cpp
lld/MachO/DriverUtils.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/Options.td
lld/test/MachO/Inputs/liballowable_client.dylib [new file with mode: 0755]
lld/test/MachO/allowable-client.s [new file with mode: 0644]