[LLD][ELF][AArch64] Add AArch64 short range thunk support
authorPeter Smith <peter.smith@arm.com>
Mon, 17 Apr 2023 17:37:05 +0000 (18:37 +0100)
committerPeter Smith <peter.smith@arm.com>
Mon, 24 Apr 2023 12:48:22 +0000 (13:48 +0100)
commitd0cdc5ddd75d6e9005f35ce199ee8fe41b4ae509
treecb1addad149f9f7603a67ed1af5633e38484cca0
parent2bb7e00b098cdbf87b9e2e2f5ec85b661664b709
[LLD][ELF][AArch64] Add AArch64 short range thunk support

The AArch64 branch immediate instruction has a 128MiB range. This
makes it suitable for use a short range thunk in the same way as
short thunks are implemented in Arm and PPC. This patch adds
support for short range thunks to AArch64.

Adding short range thunk support should mean that OutputSections
can grow to nearly 256 MiB in size without needing long-range
indirect branches.

Differential Revision: https://reviews.llvm.org/D148701
lld/ELF/Thunks.cpp
lld/test/ELF/aarch64-cortex-a53-843419-thunk.s
lld/test/ELF/aarch64-long-thunk-converge.s [new file with mode: 0644]
lld/test/ELF/aarch64-thunk-reuse2.s
lld/test/ELF/aarch64-thunk-script.s
lld/test/ELF/aarch64-thunk-section-location.s