Skip to content

Commit 87a7351

Browse files
committed
[libunwind][PAuthLR] Remove PC offset when using FEAT_PAuthLR
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.
1 parent 36bc9b7 commit 87a7351

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

libunwind/src/DwarfParser.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,6 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
808808
results->savedRegisters[UNW_AARCH64_RA_SIGN_STATE].value ^ 0x3;
809809
results->setRegisterValue(UNW_AARCH64_RA_SIGN_STATE, value,
810810
initialState);
811-
// When calculating the value of the PC, it is assumed that the CFI
812-
// instruction is placed before the signing instruction, however it is
813-
// placed after. Because of this, we need to take into account the CFI
814-
// instruction is one instruction call later than expected, and reduce
815-
// the PC value by 4 bytes to compensate.
816-
results->ptrAuthDiversifier = fdeInfo.pcStart + codeOffset - 0x4;
817811
_LIBUNWIND_TRACE_DWARF(
818812
"DW_CFA_AARCH64_negate_ra_state_with_pc(pc=0x%" PRIx64 ")\n",
819813
static_cast<uint64_t>(results->ptrAuthDiversifier));

0 commit comments

Comments
 (0)