2 // RUN
: llvm-mc
-filetype
=obj
-triple
=aarch64-none-linux
%s
-o
%t.o
3 // RUN
: echo
"SECTIONS { \
4 // RUN: .text 0x10000 : { \
5 // RUN: *(.text.01) ; \
6 // RUN: . += 0x8000000 ; \
7 // RUN: *(.text.02) } \
8 // RUN: .foo : { *(.foo_sec) } } " > %t.script
9 // RUN
: ld.lld
-pie
--fix-cortex-a53-
843419 --script
=%t.script
%t.o
-o
%t2
10 // RUN
: llvm-objdump
--no-show-raw-insn
--triple
=aarch64-linux-gnu
-d
%t2
13 /// %t2 is
> 128 Megabytes
, so delete it early.
16 /// Test case that for an OutputSection larger than the ThunkSectionSpacing
17 /// --fix-cortex-a53-
843419 will cause the size of the ThunkSection to
be
18 /// rounded up to the nearest
4KiB
20 .section .text.01, "ax", %progbits
23 .type _start, %function
25 /// Range extension thunk needed
, due to linker script
31 .type t3_ff8_ldr, %function
35 ldr x0
, [x0
, :lo12
:dat
]
38 /// Expect thunk
and patch to
be inserted here
39 // CHECK
: 0000000000011008 __AArch64ADRPThunk_far_away
:
40 // CHECK-NEXT
: 11008: adrp x16
, #134221824
41 // CHECK-NEXT
: add x16
, x16
, #16
43 // CHECK
: 0000000000012008 __CortexA53843419_11000
:
44 // CHECK-NEXT
: 12008: ldr x0
, [x0
, #168]
45 // CHECK-NEXT
: b #-4104 <t3_ff8_ldr+0xc>
47 .section .text.02, "ax", %progbits
49 .type far_away, function
53 /// Expect thunk for _start
not to have size rounded up to
4KiB as it is at
54 /// the end of the OutputSection
55 // CHECK
: 0000000008012010 far_away
:
56 // CHECK-NEXT
: 8012010: bl #8
58 // CHECK
: 0000000008012018 __AArch64ADRPThunk__start
:
59 // CHECK-NEXT
: 8012018: adrp x16
, #-134225920
60 // CHECK-NEXT
: add x16
, x16
, #0
62 // CHECK
: 0000000008012024 foo
:
63 // CHECK-NEXT
: 8012024: ret
64 .section .foo_sec, "ax", %progbits