bytecodealliance / bytecodealliance/wasmtime
Question regarding AArch64 Dwarf CFI directives used along Pointer Authentication to enable unwinding
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
#### Question goal
Clarification about the current usage of the DWARF CFI directive `DW_CFA_val_expression` by the project for the purpose of unwinding on AArch64 with Pointer Authentication enabled (i.e. `-march= -mbranch-protection=pac-ret`).
#### References
- #3183 at the origin of the GCC ticket.
- [Bug 104689](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689) opened by @akirilov-arm - aarch64: libgcc: `DW_CFA_val_expression` is not supported for RA_SIGN_SATE register
- #4195 implemented by @akirilov-arm using `.cfi_window_save` (a.k.a. `.cfi_negate_ra_state`) instead of `DW_CFA_val_expression` to set the RA state.
#### Details
Today, `DW_CFA_val_expression` is supposedly only used for backtracing in the Cranelift project.
At the end in #4195, @akirilov-arm didn't use `DW_CFA_val_expression` to set the RA state register.
The code seems to have evolved since then and moved to https://github.com/bytecodealliance/wasmtime/blob/main/crates/fiber/src/unix/aarch64.rs.
This code uses `.cfi_window_save`, so no `DW_CFA_val_expression` are emitted.
#### Question
As a conclusion, the project doesn't seem to use the exotic setting of the RA state register that was requested in [Bug 104689](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104689).
Is my understanding correct ?
Is it an issue for you if GCC's AArch64 backend removes the support for setting the RA state register with `DW_CFA_val_expression` ?
Contributor guide
Assessment
This issue has not been assessed yet.