brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · c700d71 Raw
52 lines · plain
1# REQUIRES: ppc2 3# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o4# RUN: ld.lld -shared %t.o -o %t.so5# RUN: llvm-objdump -d --no-show-raw-insn -r %t.so | FileCheck %s6 7# For a recursive call that is interposable the linker calls the plt-stub rather8# then calling the function directly. Since the call is through a plt stub and9# might be interposed with a different definition at runtime, a toc-restore is10# required to follow the call.11 12# The decision to use a plt-stub for the recursive call is not one I feel13# strongly about either way. It was done because it matches what bfd and gold do14# for recursive calls as well as keeps the logic for recursive calls consistent15# with non-recursive calls.16 17# CHECK-LABEL: 0000000000010290 <recursive_func>:18# CHECK:       102b8:       bl 0x102e019# CHECK-NEXT:               ld 2, 24(1)20 21# CHECK-LABEL: 00000000000102e0 <__plt_recursive_func>:22 23        .abiversion 224        .section ".text"25        .p2align 226        .global recursive_func27        .type recursive_func, @function28recursive_func:29.Lrf_gep:30    addis 2, 12, .TOC.-.Lrf_gep@ha31    addi  2, 2, .TOC.-.Lrf_gep@l32    .localentry recursive_func, .-recursive_func33    cmpldi 3, 234    blt   0, .Lend35 36    mflr 037    std 0, 16(1)38    stdu 1, -32(1)39    addi 5, 3, -140    mulld 4, 4, 341    mr 3, 542    bl recursive_func43    nop44    mr 4, 345    addi 1, 1, 3246    ld 0, 16(1)47    mtlr 048 49.Lend:50    extsw 3, 451    blr52