2 # RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux-gnu %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-readelf -S -s %t | FileCheck %s --check-prefix=SEC
5 # RUN: llvm-readelf -x .rodata -x .data %t | FileCheck --check-prefix=HEX %s
6 # RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
8 ## ifunc is a non-preemptable STT_GNU_IFUNC. Check we create a canonical PLT
9 ## and redirect .rodata and .data references to it.
11 # SEC: .text PROGBITS 0000000000210178
12 # SEC: .got.plt PROGBITS 0000000000220198
13 # SEC: 0000000000210180 0 FUNC GLOBAL DEFAULT 4 ifunc
15 ## .rodata[0] and .data[0] store the address of the canonical PLT.
16 # HEX: section '.rodata':
17 # HEX-NEXT: 0x00200170 80012100 00000000
18 # HEX: section '.data':
19 # HEX-NEXT: 0x00220190 80012100 00000000
22 # RELOC-NEXT: 0x220198 R_AARCH64_IRELATIVE - 0x210178
26 .type ifunc,@gnu_indirect_function