Add CFI_RESTORE_STATE_AND_DEF_CFA macro on arm
We always want to do restore_state and def_cfa together.
Test: diff generated cfa
Change-Id: I75804c9933fcb3f5db4b728fc9342f42fe07f9d0
diff --git a/runtime/arch/arm/asm_support_arm.S b/runtime/arch/arm/asm_support_arm.S
index 000a2d1..144f761 100644
--- a/runtime/arch/arm/asm_support_arm.S
+++ b/runtime/arch/arm/asm_support_arm.S
@@ -65,6 +65,14 @@
.endif
.endm
+// The spec is not clear whether the CFA is part of the saved state and tools
+// differ in the behaviour, so explicitly set the CFA to avoid any ambiguity.
+// The restored CFA state should match the CFA state during CFI_REMEMBER_STATE.
+.macro CFI_RESTORE_STATE_AND_DEF_CFA reg, offset
+ .cfi_restore_state
+ .cfi_def_cfa \reg, \offset
+.endm
+
// Macro to generate the value of Runtime::Current into rDest. As it uses labels
// then the labels need to be unique. We bind these to the function name in the ENTRY macros.
.macro RUNTIME_CURRENT name, num, rDest