[lld-macho] Support loading of zippered dylibs
authorJez Ng <jezng@fb.com>
Thu, 6 May 2021 15:18:19 +0000 (11:18 -0400)
committerJez Ng <jezng@fb.com>
Thu, 6 May 2021 15:19:40 +0000 (11:19 -0400)
commit9260760235261a5cd150b15a3499f7988da65a02
tree6f7245ed965854cabc00c2ff374be2510b72f1c8
parent7654d8e1a96cb9dda0318ff5489c17f3780f1944
[lld-macho] Support loading of zippered dylibs

ld64 can emit dylibs that support more than one platform (typically macOS and
macCatalyst). This diff allows LLD to read in those dylibs. Note that this is a
super bare-bones implementation -- in particular, I haven't added support for
LLD to emit those multi-platform dylibs, nor have I added a variety of
validation checks that ld64 does. Until we have a use-case for emitting zippered
dylibs, I think this is good enough.

Fixes PR49597.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D101954
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
lld/test/MachO/zippered.yaml [new file with mode: 0644]