brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 5226d67 Raw
75 lines · plain
1// REQUIRES: aarch642// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o3// RUN: echo "SECTIONS { \4// RUN:                  .text 0x10000 : { \5// RUN:                  *(.text.01) ; \6// RUN:                  . += 0x8000000 ;  \7// RUN:                  *(.text.02) } \8// RUN:                  .foo : { *(.foo_sec) } } " > %t.script9// RUN: ld.lld -pie --fix-cortex-a53-843419 --script=%t.script %t.o -o %t210// RUN: llvm-objdump --no-show-raw-insn --triple=aarch64-linux-gnu -d %t211 12 13/// %t2 is > 128 Megabytes, so delete it early.14// RUN: rm %t215 16/// Test case that for an OutputSection larger than the ThunkSectionSpacing17/// --fix-cortex-a53-843419 will cause the size of the ThunkSection to be18/// rounded up to the nearest 4KiB19 20 .section .text.01, "ax", %progbits21 .balign 409622 .globl _start23 .type _start, %function24_start:25/// Range extension thunk needed, due to linker script26 bl far_away27 .space 4096 - 1228 29/// Erratum sequence30 .globl t3_ff8_ldr31 .type t3_ff8_ldr, %function32t3_ff8_ldr:33 adrp x0, dat34 ldr x1, [x1, #0]35 ldr x0, [x0, :lo12:dat]36 ret37 38/// Expect thunk and patch to be inserted here39// CHECK: 0000000000011008 __AArch64ADRPThunk_far_away:40// CHECK-NEXT: 11008: adrp    x16, #13422182441// CHECK-NEXT:        add     x16, x16, #1642// CHECK-NEXT:        br      x1643// CHECK: 0000000000012008 __CortexA53843419_11000:44// CHECK-NEXT: 12008: ldr     x0, [x0, #168]45// CHECK-NEXT:        b       #-4104 <t3_ff8_ldr+0xc>46 47 .section .text.02, "ax", %progbits48 .globl far_away49 .type far_away, function50far_away:51 bl _start52 ret53/// Expect thunk for _start not to have size rounded up to 4KiB as it is at54/// the end of the OutputSection55// CHECK: 0000000008012010 far_away:56// CHECK-NEXT:  8012010: bl      #857// CHECK-NEXT:           ret58// CHECK: 0000000008012018 __AArch64ADRPThunk__start:59// CHECK-NEXT:  8012018: adrp    x16, #-13422592060// CHECK-NEXT:           add     x16, x16, #061// CHECK-NEXT:           br      x1662// CHECK: 0000000008012024 foo:63// CHECK-NEXT:  8012024: ret64 .section .foo_sec, "ax", %progbits65 .globl foo66 .type foo, function67foo:68  ret69 70 71 .section .data72 .balign 873 .globl dat74dat:    .quad 075