]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
aarch64: Fix PLT fixups when BTI is used [PR32572]
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 23 Jan 2025 10:53:54 +0000 (10:53 +0000)
committerRichard Earnshaw <rearnsha@arm.com>
Fri, 24 Jan 2025 14:54:48 +0000 (14:54 +0000)
commitd66348e851e79424f2478f6be0fbe85e38f3287a
treea800915612189dbd679277ef0c96f9f18697a7d7
parent4998f9ea9d351d546f317af80e054a5d615edaae
aarch64: Fix PLT fixups when BTI is used [PR32572]

PR ld/32572

There are two problems addressed in this PR.  Firstly, the choice of
whether or not a PLT stub needs a BTI on entry was too strict,
resulting in non-pie executables not having a BTI on their stub.  But
secondly, the logic to handle each stub types did not agree across the
various places where this information is used.

The first issue is fixed by using bfd_link_executable rather than
bfd_link_pde.  The second is addressed by recording a delta for PLT
stub alongside the stub itself.  This is then used without needing
additional logic later on since it has been pre-calculated.

A more comprehensive fix would involve creating a data structure to
describe each fixup, including a call-back function to apply any
relocations.  But that's a fairly large change and not appropriate for
backporting.
bfd/elfnn-aarch64.c