[PATCH v0 13/13] aarch64: add DWARF CFI directive for PAuth_LR

Matthieu Longo matthieu.longo@arm.com
Mon Jul 8 12:34:52 GMT 2024


This patch adds a new CFI directive (cfi_negate_ra_state_with_pc) which
set an additional bit in the RA state to inform that RA was signed with
SP but also PC as an additional diversifier.

RA state | Description
0b00     | Return address not signed (default if no cfi_negate_ra_state*)
0b01     | Return address signed with SP (cfi_negate_ra_state)
0b10     | Invalid state
0b11     | Return address signed with SP+PC (cfi_negate_ra_state_with_pc)

It also adds the relevant tests for the new cfi directive.
---
 bfd/elf-eh-frame.c                            |  1 +
 binutils/dwarf.c                              |  5 ++
 gas/dw2gencfi.c                               | 10 +++
 gas/gen-sframe.c                              | 25 +++++++-
 gas/gen-sframe.h                              |  5 +-
 gas/scfidw2gen.c                              |  1 +
 .../gas/aarch64/pac_negate_ra_state_with_pc.d | 64 +++++++++++++++++++
 .../gas/aarch64/pac_negate_ra_state_with_pc.s | 53 +++++++++++++++
 include/dwarf2.def                            |  4 +-
 include/sframe.h                              |  2 +-
 10 files changed, 165 insertions(+), 5 deletions(-)
 create mode 100644 gas/testsuite/gas/aarch64/pac_negate_ra_state_with_pc.d
 create mode 100644 gas/testsuite/gas/aarch64/pac_negate_ra_state_with_pc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v0-0013-aarch64-add-DWARF-CFI-directive-for-PAuth_LR.patch
Type: text/x-patch
Size: 10138 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20240708/cc5b5940/attachment.bin>


More information about the Binutils mailing list