aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgcc/config/aarch64/__arm_za_disable.S5
-rw-r--r--libgcc/config/aarch64/aarch64-unwind.h16
2 files changed, 21 insertions, 0 deletions
diff --git a/libgcc/config/aarch64/__arm_za_disable.S b/libgcc/config/aarch64/__arm_za_disable.S
index cff5b9c..03fc28a 100644
--- a/libgcc/config/aarch64/__arm_za_disable.S
+++ b/libgcc/config/aarch64/__arm_za_disable.S
@@ -63,3 +63,8 @@ ENTRY (__arm_za_disable)
L(end):
ret
END (__arm_za_disable)
+
+/* Hidden alias used by the unwinder. */
+.global __libgcc_arm_za_disable
+.hidden __libgcc_arm_za_disable
+.set __libgcc_arm_za_disable, __arm_za_disable
diff --git a/libgcc/config/aarch64/aarch64-unwind.h b/libgcc/config/aarch64/aarch64-unwind.h
index d669edd..9fe6c8f 100644
--- a/libgcc/config/aarch64/aarch64-unwind.h
+++ b/libgcc/config/aarch64/aarch64-unwind.h
@@ -78,4 +78,20 @@ aarch64_demangle_return_addr (struct _Unwind_Context *context,
return addr;
}
+/* SME runtime function local to libgcc, streaming compatible
+ and preserves more registers than the base PCS requires, but
+ we don't rely on that here. */
+__attribute__ ((visibility ("hidden")))
+void __libgcc_arm_za_disable (void);
+
+/* Disable the SME ZA state in case an unwound frame used the ZA
+ lazy saving scheme. */
+#undef _Unwind_Frames_Extra
+#define _Unwind_Frames_Extra(x) \
+ do \
+ { \
+ __libgcc_arm_za_disable (); \
+ } \
+ while (0)
+
#endif /* defined AARCH64_UNWIND_H && defined __ILP32__ */