xref: /llvm-project-15.0.7/bolt/test/X86/data-to-data-pcrel.s (revision d648aa1b)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: system-linux
2
3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
4# RUN: llvm-strip --strip-unneeded %t.o
5# RUN: ld.lld %t.o -o %t.exe -q --unresolved-symbols=ignore-all
6# RUN: llvm-readelf -Wr %t.exe | FileCheck %s
7# RUN: llvm-bolt --strict %t.exe --relocs -o /dev/null
8
9  .text
10  .globl _start
11  .type _start,@function
12_start:
13  .cfi_startproc
14  retq
15
16# For relocations against .text
17  call exit
18  .size _start, .-_start
19  .cfi_endproc
20
21  .data
22var:
23  .quad 0
24
25  .rodata
26var_offset64:
27  .quad var-.
28var_offset32:
29  .long var-.
30var_offset16:
31  .word var-.
32
33## Check that BOLT succeeds in strict mode in the presence of unaccounted
34## data-to-data PC-relative relocations.
35
36# CHECK: Relocation section '.rela.rodata'
37# CHECK-NEXT: Offset
38# CHECK-NEXT: R_X86_64_PC64
39# CHECK-NEXT: R_X86_64_PC32
40# CHECK-NEXT: R_X86_64_PC16
41

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026