brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 170fe8a Raw
67 lines · plain
1# REQUIRES: aarch642# RUN: rm -rf %t; split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foo.s -o %t/foo.o4# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/bar.s -o %t/bar.o5# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/test.o6 7## Dylibs that don't do lazy dynamic calls don't need dyld_stub_binder.8# RUN: %no-lsystem-lld -arch arm64 -dylib %t/foo.o -o %t/libfoo.dylib9# RUN: llvm-nm -m %t/libfoo.dylib | FileCheck --check-prefix=NOSTUB %s10 11## Binaries that don't do lazy dynamic calls but are linked against12## libSystem.dylib get a reference to dyld_stub_binder even if it's13## not needed.14# RUN: %lld -arch arm64 -lSystem -dylib %t/foo.o -o %t/libfoo.dylib15# RUN: llvm-nm -m %t/libfoo.dylib | FileCheck --check-prefix=STUB %s16 17## Dylibs that do lazy dynamic calls do need dyld_stub_binder.18# RUN: not %no-lsystem-lld -arch arm64 -dylib %t/bar.o %t/libfoo.dylib \19# RUN:     -o %t/libbar.dylib -no_fixup_chains 2>&1 | \20# RUN:     FileCheck --check-prefix=MISSINGSTUB %s21# RUN: %lld -arch arm64 -lSystem -dylib %t/bar.o  %t/libfoo.dylib \22# RUN:     -o %t/libbar.dylib -no_fixup_chains23# RUN: llvm-nm -m %t/libbar.dylib | FileCheck --check-prefix=STUB %s24 25## As do executables.26# RUN: not %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \27# RUN:     -o %t/test -no_fixup_chains 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s28# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o \29# RUN:     -o %t/test -no_fixup_chains30# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=STUB %s31 32## Test dynamic lookup of dyld_stub_binder.33# RUN: %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \34# RUN:     -o %t/test -undefined dynamic_lookup -no_fixup_chains35# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s36# RUN: %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \37# RUN:     -o %t/test -U dyld_stub_binder -no_fixup_chains38# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s39 40# MISSINGSTUB:      error: undefined symbol: dyld_stub_binder41# MISSINGSTUB-NEXT: >>> referenced by lazy binding (normally in libSystem.dylib)42 43# NOSTUB-NOT: dyld_stub_binder44# STUB: (undefined) external dyld_stub_binder (from libSystem)45# DYNSTUB: (undefined) external dyld_stub_binder (dynamically looked up)46 47#--- foo.s48.globl _foo49_foo:50 51#--- bar.s52.text53.globl _bar54_bar:55  bl _foo56  ret57 58#--- test.s59.text60.globl _main61 62.p2align 263_main:64  bl _foo65  bl _bar66  ret67