1// REQUIRES: arm 2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t 3// RUN: echo "SECTIONS { \ 4// RUN: . = SIZEOF_HEADERS; \ 5// RUN: .text_low : { *(.text_low) *(.text_low2) . = . + 0x2000000 ; *(.text_high) *(.text_high2) } \ 6// RUN: } " > %t.script 7// RUN: ld.lld --no-rosegment --script %t.script %t -o %t2 8// RUN: llvm-objdump -d %t2 --start-address=0x94 --stop-address=0xbc | FileCheck --check-prefix=CHECK1 %s 9// RUN: llvm-objdump -d %t2 --start-address=0x20000bc --stop-address=0x20000de | FileCheck --check-prefix=CHECK2 %s 10// Test that range extension thunks can handle location expressions within 11// a Section Description 12 .syntax unified 13 .section .text_low, "ax", %progbits 14 .thumb 15 .globl _start 16_start: bx lr 17 .globl low_target 18 .type low_target, %function 19low_target: 20 bl high_target 21 bl high_target2 22 23 .section .text_low2, "ax", %progbits 24 .thumb 25 .globl low_target2 26 .type low_target2, %function 27low_target2: 28 bl high_target 29 bl high_target2 30// CHECK1: Disassembly of section .text_low: 31// CHECK1-EMPTY: 32// CHECK1-NEXT: <_start>: 33// CHECK1-NEXT: 94: 4770 bx lr 34// CHECK1: <low_target>: 35// CHECK1-NEXT: 96: f000 f803 bl 0xa0 <__Thumbv7ABSLongThunk_high_target> 36// CHECK1-NEXT: 9a: f000 f806 bl 0xaa <__Thumbv7ABSLongThunk_high_target2> 37// CHECK1: <__Thumbv7ABSLongThunk_high_target>: 38// CHECK1-NEXT: a0: f240 0cbd movw r12, #189 39// CHECK1-NEXT: a4: f2c0 2c00 movt r12, #512 40// CHECK1-NEXT: a8: 4760 bx r12 41// CHECK1: <__Thumbv7ABSLongThunk_high_target2>: 42// CHECK1-NEXT: aa: f240 0cd9 movw r12, #217 43// CHECK1-NEXT: ae: f2c0 2c00 movt r12, #512 44// CHECK1-NEXT: b2: 4760 bx r12 45// CHECK1: <low_target2>: 46// CHECK1-NEXT: b4: f7ff fff4 bl 0xa0 <__Thumbv7ABSLongThunk_high_target> 47// CHECK1-NEXT: b8: f7ff fff7 bl 0xaa <__Thumbv7ABSLongThunk_high_target2> 48 49 .section .text_high, "ax", %progbits 50 .thumb 51 .globl high_target 52 .type high_target, %function 53high_target: 54 bl low_target 55 bl low_target2 56 57 .section .text_high2, "ax", %progbits 58 .thumb 59 .globl high_target2 60 .type high_target2, %function 61high_target2: 62 bl low_target 63 bl low_target2 64 65// CHECK2: <high_target>: 66// CHECK2-NEXT: 20000bc: f000 f802 bl 0x20000c4 <__Thumbv7ABSLongThunk_low_target> 67// CHECK2-NEXT: 20000c0: f000 f805 bl 0x20000ce <__Thumbv7ABSLongThunk_low_target2> 68// CHECK2: <__Thumbv7ABSLongThunk_low_target>: 69// CHECK2-NEXT: 20000c4: f240 0c97 movw r12, #151 70// CHECK2-NEXT: 20000c8: f2c0 0c00 movt r12, #0 71// CHECK2-NEXT: 20000cc: 4760 bx r12 72// CHECK2: <__Thumbv7ABSLongThunk_low_target2>: 73// CHECK2-NEXT: 20000ce: f240 0cb5 movw r12, #181 74// CHECK2-NEXT: 20000d2: f2c0 0c00 movt r12, #0 75// CHECK2-NEXT: 20000d6: 4760 bx r12 76// CHECK2: <high_target2>: 77// CHECK2-NEXT: 20000d8: f7ff fff4 bl 0x20000c4 <__Thumbv7ABSLongThunk_low_target> 78// CHECK2-NEXT: 20000dc: f7ff fff7 bl 0x20000ce <__Thumbv7ABSLongThunk_low_target2> 79