90 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t3// RUN: echo "SECTIONS { \4// RUN: . = SIZEOF_HEADERS; \5// RUN: .text_low : { *(.text_low) *(.text_low2) } \6// RUN: .text_high 0x2000000 : { *(.text_high) *(.text_high2) } \7// RUN: } " > %t.script8// RUN: ld.lld --pic-veneer --no-rosegment --script %t.script %t -o %t29// RUN: llvm-objdump --no-print-imm-hex -d %t2 | FileCheck %s10 11// Test that we can force generation of position independent thunks even when12// inputs are not pic.13 14 .syntax unified15 .section .text_low, "ax", %progbits16 .thumb17 .globl _start18_start: bx lr19 .globl low_target20 .type low_target, %function21low_target:22 bl high_target23 bl high_target224 25 .section .text_low2, "ax", %progbits26 .thumb27 .globl low_target228 .type low_target2, %function29low_target2:30 bl high_target31 bl high_target232 33// CHECK: Disassembly of section .text_low:34// CHECK-EMPTY:35// CHECK-NEXT: <_start>:36// CHECK-NEXT: 94: 4770 bx lr37// CHECK: <low_target>:38// CHECK-NEXT: 96: f000 f803 bl 0xa0 <__ThumbV7PILongThunk_high_target>39// CHECK-NEXT: 9a: f000 f807 bl 0xac <__ThumbV7PILongThunk_high_target2>40// CHECK-NEXT: 9e: d4d4 41// CHECK: <__ThumbV7PILongThunk_high_target>:42// CHECK-NEXT: a0: f64f 7c55 movw r12, #6536543// CHECK-NEXT: a4: f2c0 1cff movt r12, #51144// CHECK-NEXT: a8: 44fc add r12, pc45// CHECK-NEXT: aa: 4760 bx r1246// CHECK: <__ThumbV7PILongThunk_high_target2>:47// CHECK-NEXT: ac: f64f 7c69 movw r12, #6538548// CHECK-NEXT: b0: f2c0 1cff movt r12, #51149// CHECK-NEXT: b4: 44fc add r12, pc50// CHECK-NEXT: b6: 4760 bx r1251// CHECK: <low_target2>:52// CHECK-NEXT: b8: f7ff fff2 bl 0xa0 <__ThumbV7PILongThunk_high_target>53// CHECK-NEXT: bc: f7ff fff6 bl 0xac <__ThumbV7PILongThunk_high_target2>54 55 56 .section .text_high, "ax", %progbits57 .thumb58 .globl high_target59 .type high_target, %function60high_target:61 bl low_target62 bl low_target263 64 .section .text_high2, "ax", %progbits65 .thumb66 .globl high_target267 .type high_target2, %function68high_target2:69 bl low_target70 bl low_target271 72// CHECK: Disassembly of section .text_high:73// CHECK-EMPTY:74// CHECK-NEXT: <high_target>:75// CHECK-NEXT: 2000000: f000 f802 bl 0x2000008 <__ThumbV7PILongThunk_low_target>76// CHECK-NEXT: 2000004: f000 f806 bl 0x2000014 <__ThumbV7PILongThunk_low_target2>77// CHECK: <__ThumbV7PILongThunk_low_target>:78// CHECK-NEXT: 2000008: f240 0c83 movw r12, #13179// CHECK-NEXT: 200000c: f6cf 6c00 movt r12, #6502480// CHECK-NEXT: 2000010: 44fc add r12, pc81// CHECK-NEXT: 2000012: 4760 bx r1282// CHECK: <__ThumbV7PILongThunk_low_target2>:83// CHECK-NEXT: 2000014: f240 0c99 movw r12, #15384// CHECK-NEXT: 2000018: f6cf 6c00 movt r12, #6502485// CHECK-NEXT: 200001c: 44fc add r12, pc86// CHECK-NEXT: 200001e: 4760 bx r1287// CHECK: <high_target2>:88// CHECK-NEXT: 2000020: f7ff fff2 bl 0x2000008 <__ThumbV7PILongThunk_low_target>89// CHECK-NEXT: 2000024: f7ff fff6 bl 0x2000014 <__ThumbV7PILongThunk_low_target2>90