Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / aarch64-gnu-ifunc-nonpreemptable2.s
blob1143b46615d172067be808ff13723ddce43ac07d
1 # REQUIRES: aarch64
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
21 # RELOC: .rela.dyn {
22 # RELOC-NEXT: 0x220198 R_AARCH64_IRELATIVE - 0x210178
23 # RELOC-NEXT: }
25 .globl ifunc
26 .type ifunc,@gnu_indirect_function
27 ifunc:
28 ret
30 .rodata
31 .p2align 3
32 .xword ifunc
34 .data
35 .p2align 3
36 .xword ifunc