diff options
author | Jez Ng <jezng@fb.com> | 2020-10-07 14:50:42 -0700 |
---|---|---|
committer | Jez Ng <jezng@fb.com> | 2020-11-10 12:19:27 -0800 |
commit | 2e8e1bdb89392f8bbe1c3886b1f8da8746659bb2 (patch) | |
tree | 1f1617c1117c3c66805d27f07568f27be0636587 /lld/MachO | |
parent | 703038b35a864d06e1926237c1568a430417b0b4 (diff) | |
download | llvm-project-2e8e1bdb89392f8bbe1c3886b1f8da8746659bb2.tar.gz |
[lld-macho] Support linking against stub dylibs
Stub dylibs differ from "real" dylibs in that they lack any content in
their sections. What they do have are export tries and symbol tables,
which means we can still link against them. I am unclear how to
properly create these stub dylibs; XCode 11.3's `lipo` is able to create
stub dylibs, but those lack LC_ID_DYLIB load commands and are considered
invalid by most tooling. Newer versions of `lipo` aren't able to create
stub dylibs at all. However, recent SDKs in XCode still come with valid
stub dylibs, so it still seems worthwhile to support them. The YAML in
this diff's test was generated by taking a non-stub dylib and editing
the appropriate fields.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D89012
Diffstat (limited to 'lld/MachO')
-rw-r--r-- | lld/MachO/Driver.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp index 482e4a13a8b4..98bf5df5adac 100644 --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -312,6 +312,7 @@ static InputFile *addFile(StringRef path) { newFile = make<ObjFile>(mbref); break; case file_magic::macho_dynamically_linked_shared_lib: + case file_magic::macho_dynamically_linked_shared_lib_stub: newFile = make<DylibFile>(mbref); break; case file_magic::tapi_file: { |