brintos

brintos / llvm-project-archived public Read only

0
0
Text · 855 B · 4ec8ba4 Raw
33 lines · plain
1// This test examines whether BOLT can correctly process when2// dynamic relocation points to other entry points of the3// function.4 5# RUN: %clang %cflags -fPIC -pie %s -o %t.exe -nostdlib -Wl,-q6# RUN: llvm-bolt %t.exe -o %t.bolt > %t.out.txt7# RUN: llvm-readelf -r %t.bolt >> %t.out.txt8# RUN: llvm-objdump --disassemble-symbols=chain %t.bolt >> %t.out.txt9# RUN: FileCheck %s --input-file=%t.out.txt10 11## Check if the new address in `chain` is correctly updated by BOLT12# CHECK: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 1 entries:13# CHECK: {{.*}} R_X86_64_RELATIVE [[#%x,ADDR:]]14# CHECK: [[#ADDR]]: c3 retq15	.text16	.type   chain, @function17chain:18	movq    $1, %rax19Label:20	ret21	.size   chain, .-chain22 23	.type   _start, @function24	.global _start25_start:26	jmpq    *.Lfoo(%rip)27	ret28	.size   _start, .-_start29 30	.data31.Lfoo:32	.quad Label33