1 // This test checks processing of R_AARCH64_PREL64
/32/16 relocations
5 // REQUIRES
: system-linux
7 // RUN
: %clang
%cflags
-nostartfiles
-nostdlib
%s
-o
%t.exe
-mlittle-endian \
8 // RUN
: -Wl
,-q
-Wl
,-z
,max-page-size
=4
9 // RUN
: llvm-readelf
-Wa
%t.exe | FileCheck
%s
-check-prefix
=CHECKPREL
11 // CHECKPREL
: R_AARCH64_PREL16
{{.*}} .dummy + 0
12 // CHECKPREL-NEXT
: R_AARCH64_PREL32
{{.*}} _start + 4
13 // CHECKPREL-NEXT
: R_AARCH64_PREL64
{{.*}} _start + 8
15 // RUN
: llvm-bolt
%t.exe
-o
%t.bolt
16 // RUN
: llvm-objdump
-D
%t.bolt | FileCheck
%s
--check-prefix
=CHECKPREL32
18 // CHECKPREL32
: [[#%x,DATATABLEADDR:]] <datatable>:
19 // CHECKPREL32-NEXT
: 00:
20 // CHECKPREL32-NEXT
: 04: {{.*}} .word 0x[[#%x,VALUE:]]
22 // 4 is offset in datatable
24 // CHECKPREL32
: [[#DATATABLEADDR + 4 - 8 + VALUE]] <_start>:
26 // RUN
: llvm-objdump
-D
%t.bolt | FileCheck
%s
--check-prefix
=CHECKPREL64
27 // CHECKPREL64
: [[#%x,DATATABLEADDR:]] <datatable>:
28 // CHECKPREL64-NEXT
: 00:
29 // CHECKPREL64-NEXT
: 04:
30 // CHECKPREL64-NEXT
: 08: {{.*}} .word 0x[[#%x,VALUE:]]
31 // CHECKPREL64-NEXT
: 0c
: {{.*}} .word 0x00000000
33 // 8 is offset in datatable
35 // CHECKPREL64
: [[#DATATABLEADDR + 8 - 12 + VALUE]] <_start>:
40 .type _start, %function
46 .section .dummy, "a", @progbits
53 .hword dummy - datatable
55 .word _start - datatable
56 .xword _start - datatable