37 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/arm-shared.s -o %t1.o3// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so4// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o5// RUN: ld.lld %t.o %t1.so -o %t6// RUN: llvm-objdump --no-print-imm-hex -d --triple=armv7a-none-linux-gnueabi --start-address=0x201e4 --stop-address=0x20204 %t | FileCheck %s7 8/// When we are dynamic linking, undefined weak references have a PLT entry so9/// we must create a thunk for the branch to the PLT entry.10 11 .text12 .globl bar213 .weak undefined_weak_we_expect_a_plt_entry_for14_start:15 .globl _start16 .type _start, %function17 b undefined_weak_we_expect_a_plt_entry_for18 bl bar219/// Create 32 Mb gap between the call to the weak reference and the PLT so that20/// the b and bl need a range-extension thunk.21 .section .text.1, "ax", %progbits22 .space 32 * 1024 * 102423 24// CHECK: Disassembly of section .text:25// CHECK-EMPTY:26// CHECK-NEXT: <_start>:27// CHECK-NEXT: 201e4: ea000000 b 0x201ec <__ARMv7ABSLongThunk_undefined_weak_we_expect_a_plt_entry_for>28// CHECK-NEXT: 201e8: eb000002 bl 0x201f8 <__ARMv7ABSLongThunk_bar2>29// CHECK: <__ARMv7ABSLongThunk_undefined_weak_we_expect_a_plt_entry_for>:30// CHECK-NEXT: 201ec: e300c240 movw r12, #57631// CHECK-NEXT: 201f0: e340c202 movt r12, #51432// CHECK-NEXT: 201f4: e12fff1c bx r1233// CHECK: <__ARMv7ABSLongThunk_bar2>:34// CHECK-NEXT: 201f8: e300c230 movw r12, #56035// CHECK-NEXT: 201fc: e340c202 movt r12, #51436// CHECK-NEXT: 20200: e12fff1c bx r1237