1 ## Stub dylibs differ from "real" dylibs in that they lack any content in their
2 ## sections. What they do have are export tries and symbol tables, which means
3 ## we can still link against them. I (jezng) am unclear how to properly create
4 ## these stub dylibs; XCode 11.3's `lipo` is able to create stub dylibs, but
5 ## those lack LC_ID_DYLIB load commands and are considered invalid by most
6 ## tooling. Newer versions of `lipo` aren't able to create stub dylibs at all.
7 ## However, recent SDKs in XCode still come with valid stub dylibs, so it still
8 ## seems worthwhile to support them. The YAML in this test was generated by
9 ## taking a non-stub dylib and editing the appropriate fields.
12 # RUN: rm -rf %t; split-file %s %t
13 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
14 # RUN: yaml2obj %t/fat.dylib.yaml > %t/fat.dylib
15 # RUN: %lld -lSystem %t/test.o %t/fat.dylib -o %t/test
16 # RUN: llvm-objdump --macho --lazy-bind %t/test | FileCheck %s
17 # CHECK: __DATA __la_symbol_ptr 0x100002000 foo _foo
32 cpusubtype: 0x00000003
33 offset: 0x0000000000001000
41 cpusubtype: 0x00000003
62 addr: 0x0000000000000000
90 compatibility_version: 0
93 - cmd: LC_DYLD_INFO_ONLY
116 Flags: 0x0000000000000000
117 Address: 0x0000000000000000
118 Other: 0x0000000000000000
124 Flags: 0x0000000000000000
125 Address: 0x0000000000003FB7
126 Other: 0x0000000000000000