[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / ppc64-toc-relax-ifunc.s
blob00a63c7e5b67723ca855a6305f4227ac19df3e95
1 # REQUIRES: ppc
3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
4 # RUN: echo '.globl ifunc; .type ifunc, %gnu_indirect_function; ifunc:' | \
5 # RUN: llvm-mc -filetype=obj -triple=powerpc64le - -o %t1.o
6 # RUN: ld.lld %t.o %t1.o -o %t
7 # RUN: llvm-readelf -Ssr %t | FileCheck --check-prefix=SEC %s
8 # RUN: llvm-readelf -x .toc %t | FileCheck --check-prefix=HEX %s
9 # RUN: llvm-objdump -d %t | FileCheck --check-prefix=DIS %s
11 ## ifunc is a non-preemptable STT_GNU_IFUNC. The R_PPC64_ADDR64 in .toc
12 ## creates a canonical PLT for it and changes its type to STT_FUNC. We can thus
13 ## still perform toc-indirect to toc-relative relaxation because the distance
14 ## to the address of the canonical PLT is fixed.
16 # SEC: .text PROGBITS [[#%x,TEXT:]]
17 # SEC: .plt NOBITS [[#%x,PLT:]]
18 # SEC: {{0*}}[[#PLT]] {{.+}} R_PPC64_IRELATIVE [[#TEXT+8]]
19 # SEC: {{0*}}[[#TEXT+8]] 0 FUNC GLOBAL DEFAULT 3 ifunc
21 ## .toc[0] stores the address of the canonical PLT.
22 # HEX: section '.toc':
23 # HEX-NEXT: 0x100201f8 e8010110 00000000
25 # DIS: addi 3, 3,
27 addis 3, 2, .toc@toc@ha
28 ld 3, .toc@toc@l(3)
30 .section .toc,"aw",@progbits
31 .quad ifunc