[PATCH 0/2] aarch64: Fix issue causing out-of-range relocations
Richard Earnshaw (foss)
Richard.Earnshaw@arm.com
Fri Jan 9 14:42:06 GMT 2026
On 06/01/2026 10:54, Richard Earnshaw wrote:
> We've been seeing reports that users are encoutering issues with
> out-of-range relocation failures on aarch64 despite the linker having
> code that is supposed to insert long-branch veneers for this
> situation. Investigation suggests that it is related to the
> mitigations used for one of the Cortex-a53 errata that is perturbing
> the results of an earlier calculation and is in fact leading to the
> veneer being too far from the original branch to be reachable.
>
> The solution to this problem is to adjust the order in which we do the
> calculations so that the problematic pass is run before we create the
> veneer stub groups (the pass creates its own stubs and doesn't rely on
> the stub groups).
>
> This short series contains two patches. The first isn't strictly
> necessary, but fixes a minor issue in the names of some symbols: we
> try to look up the name of the target symbol, but sometimes that is
> empty and we thus create a rather anonymous symbol for the stub as
> well. This patch addresses this by using the section name for this
> case.
>
> The second patch is the main bug fix and is in fact less complicated
> than the diff implies; it simply moves the pass that scans for erratum
> 843419 before the code that creates the section groups.
>
> I'll hold off pushing this for a couple of days, just to allow others
> to have a look at the change.
>
> R.
Now pushed.
R.
>
> Richard Earnshaw (2):
> aarch64: Use section names for empty stub symbols
> aarch64: Fix out-of-range branch veneers when --fix-cortex-a53-843419
>
> bfd/elfnn-aarch64.c | 51 ++++++++++-------
> ld/testsuite/ld-aarch64/farcall-b-section.d | 10 ++--
> ld/testsuite/ld-aarch64/farcall-bl-section.d | 10 ++--
> .../ld-aarch64/protections/bti-far-1.d | 18 +++---
> .../ld-aarch64/protections/bti-far-2.d | 16 +++---
> .../ld-aarch64/protections/bti-far-opt.d | 56 +++++++++----------
> 6 files changed, 85 insertions(+), 76 deletions(-)
>
More information about the Binutils
mailing list