HomeFreeBSD

csu: Teach csu about PAC and BTI

Description

csu: Teach csu about PAC and BTI

Add the Branch Target Identification (BTI) note to libc assembly
sources and Pointer Authentication Code (PAC) instructions to _init and
_fini.

_init and _fini may be called indirectly so need a BTI landing pad. As
they are non-leaf functions use the appropriate PAC instruction that
also guards against changing the link register.

As all object files need the note for any binary using these object files
we need to insert it in all asm files.

Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42227

(cherry picked from commit 522126fea72419fae344fbcb897b41588909308a)

Details

Provenance
andrewAuthored on Oct 12 2023, 10:03 AM
Reviewer
markj
Differential Revision
D42227: csu: Teach libc about PAC and BTI
Parents
rG08569764e6c9: arm64: Add a missing MRS_HWCAP_END
Branches
Unknown
Tags
Unknown