brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · b9177ec Raw
68 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf --arm-add-build-attributes %s -o %t.o3// RUN: echo "SECTIONS { \4// RUN:          .text0 0x011006 : { *(.text.00) } \5// RUN:          .text1 0x110000 : { *(.text.01) *(.text.02) *(.text.03) \6// RUN:                             *(.text.04) } \7// RUN:          .text2 0x210000 : { *(.text.05) } } " > %t.script8// RUN: ld.lld --script %t.script --fix-cortex-a8 --shared -verbose %t.o -o %t2 2>&19// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t2 | FileCheck %s10 11/// Test cases for Cortex-a8 Erratum 657417 that involve interactions with12/// range extension thunks. Both erratum fixes and range extension thunks need13/// precise information and after creation alter address information.14 .thumb15 16 .section .text.00, "ax", %progbits17 .thumb_func18early:19 bx lr20 21 .section .text.01, "ax", %progbits22 .balign 409623 .globl _start24 .type _start, %function25_start:26  beq.w far_away27/// Thunk to far_away and state change needed, size 12-bytes goes here.28// CHECK: 00110004 <__ThumbV7PILongThunk_far_away>:29// CHECK-NEXT: 110004: movw    r12, #6552430// CHECK-NEXT:         movt    r12, #1531// CHECK-NEXT:         add     r12, pc32// CHECK-NEXT:         bx      r1233 34 .section .text.02, "ax", %progbits35 .space 4096 - 2236 37 .section .text.03, "ax", %progbits38 .thumb_func39target:40/// After thunk is added this branch will line up across 2 4 KiB regions41/// and will trigger a patch.42 nop.w43 bl target44 45/// Expect erratum patch inserted here46// CHECK: 00110ffa <target>:47// CHECK-NEXT: 110ffa: nop.w48// CHECK-NEXT:         bl      0x111004 <__CortexA8657417_110FFE>49// CHECK: 00111004 <__CortexA8657417_110FFE>:50// CHECK-NEXT: 111004: b.w     0x110ffa <target>51 52/// Expect range extension thunk here.53// CHECK: 00111008 <__ThumbV7PILongThunk_early>:54// CHECK-NEXT: 111008: b.w     0x11006 <early>55 56 .section .text.04, "ax", %progbits57/// The erratum patch will push this branch out of range, so another58/// range extension thunk will be needed.59        beq.w early60// CHECK:   11100c:            beq.w   0x111008 <__ThumbV7PILongThunk_early>61 62 .section .text.05, "ax", %progbits63 .arm64 nop65 .type far_away, %function66far_away:67  bx lr68