37 lines · plain
1# REQUIRES: aarch642# RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o3# RUN: ld.lld %t.o -o %t4# RUN: llvm-readelf -S -s %t | FileCheck %s --check-prefix=SEC5# RUN: llvm-readelf -x .rodata -x .data %t | FileCheck --check-prefix=HEX %s6# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC7 8## ifunc is a non-preemptable STT_GNU_IFUNC. Check we create a canonical PLT9## and redirect .rodata and .data references to it.10 11# SEC: .text PROGBITS 000000000021017812# SEC: .got.plt PROGBITS 000000000022019813# SEC: 0000000000210180 0 FUNC GLOBAL DEFAULT 4 ifunc14 15## .rodata[0] and .data[0] store the address of the canonical PLT.16# HEX: section '.rodata':17# HEX-NEXT: 0x00200170 80012100 0000000018# HEX: section '.data':19# HEX-NEXT: 0x00220190 80012100 0000000020 21# RELOC: .rela.dyn {22# RELOC-NEXT: 0x220198 R_AARCH64_IRELATIVE - 0x21017823# RELOC-NEXT: }24 25.globl ifunc26.type ifunc,@gnu_indirect_function27ifunc:28 ret29 30.rodata31.p2align 332.xword ifunc33 34.data35.p2align 336.xword ifunc37