3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o
4 # RUN: ld.lld -shared %t.o -o %t.so
5 # RUN: llvm-objdump -d --no-show-raw-insn -r %t.so | FileCheck %s
7 # For a recursive call that is interposable the linker calls the plt-stub rather
8 # then calling the function directly. Since the call is through a plt stub and
9 # might be interposed with a different definition at runtime, a toc-restore is
10 # required to follow the call.
12 # The decision to use a plt-stub for the recursive call is not one I feel
13 # strongly about either way. It was done because it matches what bfd and gold do
14 # for recursive calls as well as keeps the logic for recursive calls consistent
15 # with non-recursive calls.
17 # CHECK-LABEL: 0000000000010290 <recursive_func>:
18 # CHECK: 102b8: bl 0x102e0
19 # CHECK-NEXT: ld 2, 24(1)
21 # CHECK-LABEL: 00000000000102e0 <__plt_recursive_func>:
26 .global recursive_func
27 .type recursive_func, @function
30 addis 2, 12, .TOC.-.Lrf_gep@ha
31 addi 2, 2, .TOC.-.Lrf_gep@l
32 .localentry recursive_func, .-recursive_func