75 lines · plain
1// This test checks that the gold linker style veneer are properly handled2// by BOLT.3// Strip .rela.mytext section to simulate inserted by a linker veneers4// that does not contain relocations.5 6# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \7# RUN: %s -o %t.o8# RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -nostdlib \9# RUN: -fuse-ld=lld -Wl,--no-relax -Wl,-q10# RUN: llvm-objcopy --remove-section .rela.mytext %t.exe11# RUN: llvm-objdump -d -j .mytext %t.exe | \12# RUN: FileCheck --check-prefix=CHECKVENEER %s13# RUN: llvm-bolt %t.exe -o %t.bolt --elim-link-veneers=true \14# RUN: --lite=0 --use-old-text=015# RUN: llvm-objdump -d -j .text %t.bolt | FileCheck %s16 17.text18.balign 419.global dummy20.type dummy, %function21dummy:22 adrp x1, dummy23 ret24.size dummy, .-dummy25 26.section ".mytext", "ax"27.balign 428.global foo29.type foo, %function30foo:31# CHECK: <foo>:32# CHECK-NEXT: {{.*}} bl {{.*}} <foo2>33 bl .L234 ret35.size foo, .-foo36 37.global foo238.type foo2, %function39foo2:40# CHECK: <foo2>:41# CHECK-NEXT: {{.*}} bl {{.*}} <foo2>42 bl .L243 ret44.size foo2, .-foo245 46.global _start47.type _start, %function48_start:49# CHECK: <_start>:50# CHECK-NEXT: {{.*}} bl {{.*}} <foo>51 bl .L152 adr x0, .L053 ret54.L0:55 .xword 056.size _start, .-_start57.L1:58# CHECKVENEER: adrp59# CHECKVENEER-NEXT: add60# CHECKVENEER-NEXT: br61# CHECKVENEER-NEXT: nop62 adrp x16, foo63 add x16, x16, #:lo12:foo64 br x1665 nop66.L2:67# CHECKVENEER-NEXT: adrp68# CHECKVENEER-NEXT: add69# CHECKVENEER-NEXT: br70# CHECKVENEER-NEXT: nop71 adrp x16, foo272 add x16, x16, #:lo12:foo273 br x1674 nop75