[PATCH v2 4/5] libdwfl, aarch64: extend dwfl_thread_state_registers to handle PAC

2024-08-26 Thread Steve Capper
On AArch64 systems with pointer authentication enabled, one needs to know the PAC mask in order to unwind functions that employ PAC. This patch extends dwfl_thread_state_registers to handle the PAC mask information by introducing a special register -2. (-1 is used in a similar manner already for h

[PATCH v2 5/5] libdwfl, aarch64: Read PAC mask from core

2024-08-26 Thread Steve Capper
We need to read the PAC mask from a core file when debugging offline as the information is still needed to demangle return addresses. This commit pulls out the NT_ARM_PAC_MASK info from the core and feeds it through to dwfl_thread_state_registers for each thread. Signed-off-by: Steve Capper ---

[PATCH v2 3/5] libdwfl, aarch64: Demangle return addresses using a PAC mask

2024-08-26 Thread Steve Capper
From: German Gomez Demangle mangled return addresses on AARCH64. The value of the masks is stored in the struct Dwfl_Thread. Signed-off-by: German Gomez [SteveC: remove dwfl_thread_state_aarch64_pauth] Signed-off-by: Steve Capper --- libdwfl/dwfl_frame.c | 3 +++ libdwfl/frame_unwind.c | 1

[PATCH v2 2/5] libdw, aarch64: Implement DW_CFA_AARCH64_negate_ra_state CFI instruction

2024-08-26 Thread Steve Capper
From: German Gomez Implement DW_CFA_AARCH64_negate_ra_state in accordance with the DWARF AARCH64 ABI [1]. Followup commits will use the value of this register to remove the PAC from return addresses. [1] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#44call-frame-inst

[PATCH v2 1/5] aarch64: Create definitions for AARCH64_RA_SIGN_STATE register

2024-08-26 Thread Steve Capper
From: German Gomez This register will be used to indicate whether a return address is mangled with a PAC or not, in accordance with the DWARF AARCH64 ABI [1]. [1] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst#41dwarf-register-names Signed-off-by: German Gomez [Steve

[PATCH v2 0/5] Enable PAC support in elfutils

2024-08-26 Thread Steve Capper
Hello, This series enables Pointer Authentication (PAC) support in elfutils. The first three patches were originally posted by German Gomez. I've rewritten a new patch to extend the dwfl_thread_state_registers function to handle the PAC mask and added an extra patch that was required to debug core