summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-03-11 07:22:24 -0400
committermidipix <writeonce@midipix.org>2019-03-12 02:53:39 -0400
commiteb6ea6e659f8c46a2730866a8ec9f01cbe856a43 (patch)
treec0880a2dc83c0dc77d98fe7a83852441cbea4682
parent3f15a75d2f059828a390477eb9667ff36ff07f1b (diff)
downloadcbb-gcc-4.6.4-eb6ea6e659f8c46a2730866a8ec9f01cbe856a43.tar.bz2
cbb-gcc-4.6.4-eb6ea6e659f8c46a2730866a8ec9f01cbe856a43.tar.xz
libobjc/exception.c: support target-provided exception filters.
-rw-r--r--libobjc/exception.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libobjc/exception.c b/libobjc/exception.c
index 1ffb80b53..239320240 100644
--- a/libobjc/exception.c
+++ b/libobjc/exception.c
@@ -22,6 +22,10 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#ifdef TARGET_PERSONALITY_FUNCTION_MIDIPIX
+#include "unwind-midipix.h"
+#endif
+
#include "objc-private/common.h"
#include <stdlib.h>
#include "config.h"
@@ -225,6 +229,8 @@ get_ttype_entry (struct lsda_header_info *info, _Unwind_Word i)
#ifdef SJLJ_EXCEPTIONS
#define PERSONALITY_FUNCTION __gnu_objc_personality_sj0
#define __builtin_eh_return_data_regno(x) x
+#elif defined(TARGET_PERSONALITY_FUNCTION)
+#define PERSONALITY_FUNCTION __gnu_objc_personality_imp
#else
#define PERSONALITY_FUNCTION __gnu_objc_personality_v0
#endif
@@ -240,6 +246,9 @@ get_ttype_entry (struct lsda_header_info *info, _Unwind_Word i)
} \
while (0)
+#ifdef TARGET_PERSONALITY_FUNCTION
+static
+#endif
_Unwind_Reason_Code
PERSONALITY_FUNCTION (_Unwind_State state,
struct _Unwind_Exception *ue_header,
@@ -509,6 +518,21 @@ PERSONALITY_FUNCTION (int version,
return _URC_INSTALL_CONTEXT;
}
+#ifdef TARGET_PERSONALITY_FUNCTION_MIDIPIX
+
+int __gnu_objc_personality_seh0(
+ struct _nt_exception_record * erec,
+ void * this_frame,
+ mcontext_t * tctx,
+ struct _nt_dispatcher_context * dctx)
+{
+ return __unwind_exception_filter(
+ erec,this_frame,tctx,dctx,
+ __gnu_objc_personality_imp);
+}
+
+#endif
+
static void
__objc_exception_cleanup (_Unwind_Reason_Code code __attribute__((unused)),
struct _Unwind_Exception *exc)