2018-11-21 19:30:03 +08:00
|
|
|
// REQUIRES: arm
|
2018-05-08 17:26:06 +08:00
|
|
|
// RUN: llvm-mc %s --arm-add-build-attributes --triple=armv7a-linux-gnueabihf --filetype=obj -o %t.o
|
|
|
|
// RUN: ld.lld %t.o -o %t
|
2021-07-29 03:47:12 +08:00
|
|
|
// RUN: llvm-objdump -d --start-address=0x2200b4 --stop-address=0x2200be %t | FileCheck %s
|
2018-05-08 17:26:06 +08:00
|
|
|
|
2020-04-18 23:06:37 +08:00
|
|
|
/// Create a conditional branch too far away from a precreated thunk
|
|
|
|
/// section. This will need a thunk section created within range.
|
2018-05-08 17:26:06 +08:00
|
|
|
.syntax unified
|
|
|
|
.thumb
|
|
|
|
|
|
|
|
.section .text.0, "ax", %progbits
|
|
|
|
.space 2 * 1024 * 1024
|
|
|
|
.globl _start
|
|
|
|
.type _start, %function
|
|
|
|
_start:
|
2020-04-18 23:06:37 +08:00
|
|
|
/// Range of +/- 1 Megabyte, new ThunkSection will need creating after
|
|
|
|
/// .text.1
|
2018-05-08 17:26:06 +08:00
|
|
|
beq.w target
|
|
|
|
.section .text.1, "ax", %progbits
|
|
|
|
bx lr
|
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
// CHECK: <_start>:
|
2021-06-30 17:34:52 +08:00
|
|
|
// CHECK-NEXT: 2200b4: 00 f0 00 80 beq.w 0x2200b8 <__Thumbv7ABSLongThunk_target>
|
2020-03-06 06:18:38 +08:00
|
|
|
// CHECK: <__Thumbv7ABSLongThunk_target>:
|
2021-06-30 17:34:52 +08:00
|
|
|
// CHECK-NEXT: 2200b8: 00 f0 01 90 b.w 0xe200be <target>
|
2020-04-18 23:06:37 +08:00
|
|
|
// CHECK: 2200bc: 70 47 bx lr
|
2018-05-08 17:26:06 +08:00
|
|
|
|
|
|
|
.section .text.2, "ax", %progbits
|
|
|
|
.space 12 * 1024 * 1024
|
|
|
|
.globl target
|
|
|
|
.type target, %function
|
|
|
|
target: bx lr
|