Welcome to mirror list, hosted at ThFree Co, Russian Federation.

r_aarch64_prelxx.s « AArch64 « runtime « test « bolt - github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 89bc6ccf667fbb4d6e4f09c78ecb88b455261bc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// This test checks processing of R_AARCH64_PREL64/32/16 relocations

// RUN: %clang %cflags -nostartfiles -nostdlib %s -o %t.exe -Wl,-q \
// RUN:     -Wl,-z,max-page-size=4
// RUN: llvm-readelf -Wa %t.exe | FileCheck %s -check-prefix=CHECKPREL

// CHECKPREL:       R_AARCH64_PREL16      {{.*}} .dummy + 0
// CHECKPREL-NEXT:  R_AARCH64_PREL32      {{.*}} _start + 4
// CHECKPREL-NEXT:  R_AARCH64_PREL64      {{.*}} _start + 8

// RUN: llvm-bolt %t.exe -o %t.bolt
// RUN: llvm-readobj -S --section-data %t.bolt | FileCheck %s

// CHECK: Name: .data
// CHECK: SectionData (
// CHECK:   0000: FCFF0000 44FF3F00 44FF3F00 00000000
// CHECK: )

  .text
  .align 4
  .globl _start
  .type _start, %function
_start:
  adr x0, datatable
  mov x0, #0
  ret 

.section .dummy, "da"
dummy:
  .word 0

.section .data
datatable:
  .hword dummy - datatable
  .align 2
  .word _start - datatable
  .xword _start - datatable