68 lines · plain
1# REQUIRES: x862 3## --no-leading-lines needed for .tbd files.4# RUN: rm -rf %t; split-file --no-leading-lines %s %t5 6# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o7# RUN: %lld -o %t/main -L%t -lFoo -lBar -lSystem %t/main.o8# RUN: llvm-objdump --lazy-bind -d --no-show-raw-insn %t/main | FileCheck %s9 10# CHECK: callq 0x[[#%x,FOO_OFF:]]11# CHECK-NEXT: callq 0x[[#%x,BAR_OFF:]]12 13# CHECK: [[#%x,BAR_OFF]]: jmpq {{.*}} ## 0x[[#%x,BAR_BIND:]]14# CHECK: [[#%x,FOO_OFF]]: jmpq {{.*}} ## 0x[[#%x,FOO_BIND:]]15 16# CHECK-LABEL: Lazy bind table:17# CHECK-DAG: __DATA __la_symbol_ptr 0x[[#%x,FOO_BIND]] Foo _foo18# CHECK-DAG: __DATA __la_symbol_ptr 0x[[#%x,BAR_BIND]] Foo _bar19 20# RUN: llvm-nm -m %t/main | FileCheck --check-prefix=NM %s21 22# NM-DAG: _bar (from Foo)23# NM-DAG: _foo (from Foo)24 25# RUN: llvm-otool -L %t/main | FileCheck %s --check-prefix=LOAD26 27# LOAD: Foo.dylib28# LOAD-NOT: Foo.dylib29 30#--- libFoo.tbd31--- !tapi-tbd32tbd-version: 433targets: [ x86_64-macos ]34uuids:35 - target: x86_64-macos36 value: 00000000-0000-0000-0000-00000000000037install-name: 'Foo.dylib'38current-version: 0001.001.139exports:40 - targets: [ x86_64-macos ]41 symbols: [ _foo ]42...43 44#--- libBar.tbd45--- !tapi-tbd46tbd-version: 447targets: [ x86_64-macos ]48uuids:49 - target: x86_64-macos50 value: 00000000-0000-0000-0000-00000000000051## Also uses Foo.dylib as install-name!52## Normally, this would happen conditionally via an $ld$ symbol.53install-name: 'Foo.dylib'54current-version: 0001.001.155exports:56 - targets: [ x86_64-macos ]57 symbols: [ _bar ]58...59 60#--- main.s61.section __TEXT,__text62.globl _main, _foo, _bar63 64_main:65 callq _foo66 callq _bar67 ret68