[libunwind] [libunwind][PAuthLR] Remove PC offset when using FEAT_PAuthLR (PR #164224)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 20 02:08:50 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libunwind
Author: Jack Styles (Stylie777)
<details>
<summary>Changes</summary>
When originally introduced to libunwind as part of #<!-- -->112171, FEAT_PAuthLR had its Call Frame Instruction's (CFI's) in a different location to other Signing Authentication methods. To incorporate this in libunwind, an offset was introduced to work with this. However, this design was reversed in #<!-- -->121551 so the CFI's are emitted in the same location as other methods. When making this change, the offset in libunwind was not removed, so libunwinds PC value would be incorrect.
This can be removed from the code, as it is no longer needed.
---
Full diff: https://github.com/llvm/llvm-project/pull/164224.diff
1 Files Affected:
- (modified) libunwind/src/DwarfParser.hpp (-6)
``````````diff
diff --git a/libunwind/src/DwarfParser.hpp b/libunwind/src/DwarfParser.hpp
index 25250e0810987..625780f1f4558 100644
--- a/libunwind/src/DwarfParser.hpp
+++ b/libunwind/src/DwarfParser.hpp
@@ -808,12 +808,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
results->savedRegisters[UNW_AARCH64_RA_SIGN_STATE].value ^ 0x3;
results->setRegisterValue(UNW_AARCH64_RA_SIGN_STATE, value,
initialState);
- // When calculating the value of the PC, it is assumed that the CFI
- // instruction is placed before the signing instruction, however it is
- // placed after. Because of this, we need to take into account the CFI
- // instruction is one instruction call later than expected, and reduce
- // the PC value by 4 bytes to compensate.
- results->ptrAuthDiversifier = fdeInfo.pcStart + codeOffset - 0x4;
_LIBUNWIND_TRACE_DWARF(
"DW_CFA_AARCH64_negate_ra_state_with_pc(pc=0x%" PRIx64 ")\n",
static_cast<uint64_t>(results->ptrAuthDiversifier));
``````````
</details>
https://github.com/llvm/llvm-project/pull/164224
More information about the cfe-commits
mailing list