runtime: on ARM32 EABI, don't get LSDA if compact model is used
On ARM32 EABI, when the "compact" unwinding model is used, it
does not have standard LSDA and _Unwind_GetLanguageSpecificData
will not return data that is parseable by us. Check this
conditon before calling _Unwind_GetLanguageSpecificData.
Fix ARM32 build.
Change-Id: I24dfbdd61530ebf3ecae83b1764f751d676f4b20
Reviewed-on: https://go-review.googlesource.com/c/155758
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/libgo/runtime/go-unwind.c b/libgo/runtime/go-unwind.c
index f4bbfb6..388d7c7 100644
--- a/libgo/runtime/go-unwind.c
+++ b/libgo/runtime/go-unwind.c
@@ -646,6 +646,17 @@
_sleb128_t index;
int size;
+#ifdef __ARM_EABI_UNWINDER__
+ {
+ _Unwind_Control_Block *ucbp;
+ ucbp = (_Unwind_Control_Block *) _Unwind_GetGR (context, 12);
+ if (*ucbp->pr_cache.ehtp & (1u << 31))
+ // The "compact" model is used, with one of the predefined
+ // personality functions. It doesn't have standard LSDA.
+ return NOTFOUND_OK;
+ }
+#endif
+
language_specific_data = (const unsigned char *)
_Unwind_GetLanguageSpecificData (context);