[llvm] Revert "[AArch64] Correct position of CFI Instruction for Pointer Authentication (#121559) (PR #137795)

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 29 06:01:27 PDT 2025


ostannard wrote:

When PAuth_LR is used, libunwind relies on this behavior to capture the PC value which will be used to authenticate the return address. Reverting this will turn this from a wrong-debug-info bug into a wrong-code bug for C++ exceptions, so I don't think it should be committed as-is. The options I see are:
* Revert this only for `.cfi_negate_ra_state`, giving us more time to find the right fix for `.cfi_negate_ra_state_with_pc`
* Change the ABI to make it clear that the unwind opcode must be associated with the PC of the instruction after the PAC instruction. Then commit this revert along with a libunwind change to apply a 4-byte offset to the captured PC, so that exception unwinding continues to work. Alternatively, clarify that it must be at the same address as the PAC instruction, but that breaks the usual rules for debug info so I prefer the former option.
* I think there's been some discussion about replacing these directives (at least `.cfi_negate_ra_state_with_pc`) with something which works better for functions with multiple returns, if that goes ahead maybe we could deprecate `.cfi_negate_ra_state_with_pc` in favour of it.

https://github.com/llvm/llvm-project/pull/137795


More information about the llvm-commits mailing list