2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This file defines _Unwind_RaiseException() etc. using the SJLJ
9 * (setjmp()/longjmp()-based) versions provided by PNaCl's libstdc++.
11 * This allows a single build of libstdc++ to support both the SJLJ
12 * and non-SJLJ models of C++ exception handling. The SJLJ version is
13 * enabled by linking in this redirection file.
19 struct _Unwind_Exception;
21 int __pnacl_eh_sjlj_Unwind_RaiseException(struct _Unwind_Exception *exc);
22 int __pnacl_eh_sjlj_Unwind_Resume_or_Rethrow(struct _Unwind_Exception *exc);
23 void __pnacl_eh_sjlj_Unwind_DeleteException(struct _Unwind_Exception *exc);
24 void __pnacl_eh_sjlj_cxa_call_unexpected(struct _Unwind_Exception *exc);
27 int _Unwind_RaiseException(struct _Unwind_Exception *exc) {
28 return __pnacl_eh_sjlj_Unwind_RaiseException(exc);
31 int _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *exc) {
32 return __pnacl_eh_sjlj_Unwind_Resume_or_Rethrow(exc);
35 void _Unwind_DeleteException(struct _Unwind_Exception *exc) {
36 __pnacl_eh_sjlj_Unwind_DeleteException(exc);
39 void __cxa_call_unexpected(struct _Unwind_Exception *exc) {
40 __pnacl_eh_sjlj_cxa_call_unexpected(exc);
44 * This is a dummy version of the C++ personality function to prevent
45 * libstdc++'s eh_personality.cc from being linked in, since that file
46 * also defines __cxa_call_unexpected(), which would clash with our
49 * The only references to this personality function will be from LLVM
50 * "landingpad" instructions, which will be removed by the PNaClSjLjEH
53 void __gxx_personality_v0() {