2 # RUN: rm -rf %t; split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foo.s -o %t/foo.o
4 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/bar.s -o %t/bar.o
5 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/test.o
6 # RUN: %lld -arch arm64 -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/libfoo.dylib
7 # RUN: %lld -arch arm64 -dylib -install_name @executable_path/libbar.dylib %t/bar.o -o %t/libbar.dylib
8 # RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o -o %t/test
10 # RUN: llvm-objdump --no-print-imm-hex --macho -d --no-show-raw-insn --section="__TEXT,__stubs" --section="__TEXT,__stub_helper" %t/test | FileCheck %s
13 # CHECK-NEXT: bl 0x[[#%x,FOO:]] ; symbol stub for: _foo
14 # CHECK-NEXT: bl 0x[[#%x,BAR:]] ; symbol stub for: _bar
17 # CHECK-LABEL: Contents of (__TEXT,__stubs) section
18 # CHECK-NEXT: [[#BAR]]: adrp x16
19 # CHECK-NEXT: ldr x16, [x16{{.*}}] ; literal pool symbol address: _bar
21 # CHECK-NEXT: [[#FOO]]: adrp x16
22 # CHECK-NEXT: ldr x16, [x16{{.*}}] ; literal pool symbol address: _foo
25 # CHECK-LABEL: Contents of (__TEXT,__stub_helper) section
26 # CHECK-NEXT: [[#%x,HELPER_HEADER:]]: adrp x17
27 # CHECK-NEXT: add x17, x17
28 # CHECK-NEXT: stp x16, x17, [sp, #-16]!
29 # CHECK-NEXT: adrp x16
30 # CHECK-NEXT: ldr x16, [x16] ; literal pool symbol address: dyld_stub_binder
32 # CHECK-NEXT: ldr w16, 0x[[#%x,BAR_BIND_OFF_ADDR:]]
33 # CHECK-NEXT: b 0x[[#HELPER_HEADER]]
34 # CHECK-NEXT: [[#BAR_BIND_OFF_ADDR]]: udf #0
35 # CHECK-NEXT: ldr w16, 0x[[#%x,FOO_BIND_OFF_ADDR:]]
36 # CHECK-NEXT: b 0x[[#HELPER_HEADER]]
37 # CHECK-NEXT: [[#FOO_BIND_OFF_ADDR]]: udf #11