thread.process = process;
thread.unwound = NULL;
thread.callbacks_arg = NULL;
+ thread.aarch64.pauth_insn_mask = 0;
+
for (;;)
{
thread.tid = process->callbacks->next_thread (dwfl,
thread.process = process;
thread.unwound = NULL;
thread.callbacks_arg = NULL;
+ thread.aarch64.pauth_insn_mask = 0;
if (process->callbacks->get_thread (dwfl, tid, process->callbacks_arg,
&thread.callbacks_arg))
/* Some architectures encode some extra info in the return address. */
if (regno == frame->fde->cie->return_address_register)
- regval &= ebl_func_addr_mask (ebl);
+ {
+ regval &= ebl_func_addr_mask (ebl);
+
+ /* In aarch64, pseudo-register RA_SIGN_STATE indicates whether the
+ return address needs demangling using the PAC mask from the
+ thread. */
+ if (cfi->e_machine == EM_AARCH64 &&
+ frame->nregs > DW_AARCH64_RA_SIGN_STATE &&
+ frame->regs[DW_AARCH64_RA_SIGN_STATE].value & 0x1)
+ {
+ regval &= ~(state->thread->aarch64.pauth_insn_mask);
+ }
+ }
/* This is another strange PPC[64] case. There are two
registers numbers that can represent the same DWARF return
/* Bottom (innermost) frame while we're initializing, NULL afterwards. */
Dwfl_Frame *unwound;
void *callbacks_arg;
+
+ /* Data for handling AARCH64 (currently limited to demangling PAC from
+ return addresses). */
+ struct {
+ Dwarf_Addr pauth_insn_mask;
+ } aarch64;
};
/* See its typedef in libdwfl.h. */