2 // RUN
: split-file
%s
%t
3 // RUN
: llvm-mc
-filetype
=obj
-triple
=aarch64
--asm-macro-max-nesting-depth
=40000 %t/asm
-o
%t.o
4 // RUN
: ld.lld
-T %t/lds
-fix-cortex-a53-
843419 %t.o
-o
%t2
--print-map
2>&1 | FileCheck
%s
5 /// %t2 is more than
128MiB. Delete it early.
9 /// We use
%(\parameter
) to evaluate expression
, which requires
.altmacro.
12 /// Test to reproduce the conditions that trigger R_AARCH64_JUMP26 out of range
13 /// errors in pr44071. We create
a large number of patches
and thunks
, with an
14 /// LLD with the fault
, the patches will
be inserted after the thunks
and due
15 /// to the size of the thunk section some of the patches go out of range.
16 /// With
a fixed LLD the patches are inserted before the thunks.
18 // CHECK
: <internal
>:(.text.patch)
19 // CHECK
: <internal
>:(.text.thunk)
21 /// Macro to generate the cortex-a53-
843419 patch sequence
22 .macro ERRATA from, to
27 ldr x0
, [x0
, :got_lo12
:dat1
]
34 .section .text.01, "ax", %progbits
37 .type _start, %function
40 /// Generate lots of patches.
50 /// Generate long range thunks. These are inserted before the patches. Generate
51 /// a sufficient number such that the patches must
be placed before the
52 /// .text.thunk section, and if they aren't some of the patches go out of
54 .section .text.02, "ax", %progbits
60 .section .text.03, "ax", %progbits
63 .space (1024 * 1024 * 96) + (120 * 4 * 1024)
66 .section .text.04, "ax", %progbits
73 .type far\from, %function
81 /// Define the thunk targets
82 .section .target, "ax", %progbits
92 low PT_LOAD FLAGS(0x1 | 0x4);
93 high PT_LOAD FLAGS(0x1 | 0x4);
96 .text1 0x10000 : { *(.text.*) } :low
97 .text2 0xf010000 : { *(.target) } :high