[AArch64] Add .cfi_non_hint_pauth_frame when PAuth_LR instructions used for signing (#233885)
The .cfi_set_ra_state directive indicates whether the value of PC was used
as a diversifier for return address signing. However, it is not sufficient
to distinguish whether hint-space instructions were used.
For example, when PSTATE.PACM is 1, then the PACIASP instruction is extended
to take the PC as an additional diversifier. This means that the hint-space
sequence PACM; PACIASP may produce the same result as the FEAT_PAUTH_LR
instruction PACIASPPC.
However, if PACM has a trivial implementation and does not affect PSTATE.PACM,
the sequences will give different results [1].
If FEAT_PAuth_LR instructions were used to sign the return address, the
CFI directive .cfi_non_hint_pauth_frame is emitted for the frame and the
'N' character will be added to the CIE augmentation string [2]. Libunwind
uses this information to recover the correct sequence of instructions for
authentication which matches signing (e.g. PACM; AUTIA1716 or AUTIA171615).
[1] Issue: ARM-software/abi-aa#396
[2] ABI: https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#43common-information-entries
GitOrigin-RevId: e663afa59dc6cfb4a33e96ed380db00e7edf8e70
3 files changed