brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ba8262f Raw
70 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t3// RUN: echo "SECTIONS { \4// RUN:       .text 0x100000 : { *(SORT_BY_NAME(.text.*)) } \5// RUN:       }" > %t.script6// RUN: ld.lld --script %t.script %t -o %t27// RUN: llvm-objdump -d %t2 --start-address=0x100000 --stop-address=0x100008 | FileCheck --check-prefix=CHECK1 %s8// RUN: llvm-objdump -d %t2 --start-address=0x1000004 --stop-address=0x100000e | FileCheck --check-prefix=CHECK2 %s9 10 .syntax unified11 12// Test that linkerscript sorting does not apply to Thunks, we expect that the13// sort will reverse the order of sections presented here.14 15// Define a function aligned on a megabyte boundary16 .macro FUNCTION suff17 .section .text.\suff\(), "ax", %progbits18 .thumb19 .balign 0x10000020 .globl tfunc\suff\()21 .type  tfunc\suff\(), %function22tfunc\suff\():23 bx lr24 .endm25 26 FUNCTION 3127 FUNCTION 3028 FUNCTION 2929 FUNCTION 2830 FUNCTION 2731 FUNCTION 2632 FUNCTION 2533 FUNCTION 2434 FUNCTION 2335 FUNCTION 2236 FUNCTION 2137 FUNCTION 2038 FUNCTION 1939 FUNCTION 1840 FUNCTION 1741 FUNCTION 1642 FUNCTION 1543// CHECK2: <__Thumbv7ABSLongThunk_tfunc31>:44// CHECK2-NEXT:  1000004:       f3ff 97fc       b.w     0x2000000 <tfunc31>45 FUNCTION 1446 FUNCTION 1347 FUNCTION 1248 FUNCTION 1149 FUNCTION 1050 FUNCTION 0951 FUNCTION 0852 FUNCTION 0753 FUNCTION 0654 FUNCTION 0555 FUNCTION 0456 FUNCTION 0357 FUNCTION 0258 FUNCTION 0159 .section .text.00, "ax", %progbits60 .thumb61 .globl _start62_start:63// Expect no range extension needed for tfunc01 and an extension needed for64// tfunc3165 bl tfunc0166 bl tfunc3167// CHECK1: <_start>:68// CHECK1-NEXT:   100000:       f0ff fffe       bl      0x200000 <tfunc01>69// CHECK1-NEXT:   100004:       f2ff d7fe       bl      0x1000004 <__Thumbv7ABSLongThunk_tfunc31>70