41 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o4# RUN: llvm-strip --strip-unneeded %t.o5# RUN: ld.lld %t.o -o %t.exe -q --unresolved-symbols=ignore-all6# RUN: llvm-readelf -Wr %t.exe | FileCheck %s7# RUN: llvm-bolt --strict %t.exe --relocs -o %t.null8 9 .text10 .globl _start11 .type _start,@function12_start:13 .cfi_startproc14 retq15 16# For relocations against .text17 call exit18 .size _start, .-_start19 .cfi_endproc20 21 .data22var:23 .quad 024 25 .rodata26var_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 unaccounted34## data-to-data PC-relative relocations.35 36# CHECK: Relocation section '.rela.rodata'37# CHECK-NEXT: Offset38# CHECK-NEXT: R_X86_64_PC6439# CHECK-NEXT: R_X86_64_PC3240# CHECK-NEXT: R_X86_64_PC1641