1 /* Copyright (c) 2008 Travis Geiselbrecht
2 *
3 * Use of this source code is governed by a MIT-style
4 * license that can be found in the LICENSE file or at
5 * https://opensource.org/licenses/MIT
6 */
7
8 /* some cruft we have to define when using the linux toolchain */
9 #include <unwind.h>
10
11 #pragma GCC diagnostic ignored "-Wmissing-declarations"
12
13 void *__dso_handle;
14
15 #if defined(__ARM_EABI_UNWINDER__) && __ARM_EABI_UNWINDER__
16
17 /* Our toolchain has eabi functionality built in, but they're not really used.
18 * so we stub them out here. */
__aeabi_unwind_cpp_pr0(_Unwind_State state,_Unwind_Control_Block * ucbp,_Unwind_Context * context)19 _Unwind_Reason_Code __aeabi_unwind_cpp_pr0(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) {
20 return _URC_FAILURE;
21 }
22
__aeabi_unwind_cpp_pr1(_Unwind_State state,_Unwind_Control_Block * ucbp,_Unwind_Context * context)23 _Unwind_Reason_Code __aeabi_unwind_cpp_pr1(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) {
24 return _URC_FAILURE;
25 }
26
__aeabi_unwind_cpp_pr2(_Unwind_State state,_Unwind_Control_Block * ucbp,_Unwind_Context * context)27 _Unwind_Reason_Code __aeabi_unwind_cpp_pr2(_Unwind_State state, _Unwind_Control_Block *ucbp, _Unwind_Context *context) {
28 return _URC_FAILURE;
29 }
30
31 #endif
32
33 /* needed by some piece of EABI */
raise(void)34 void raise(void) {
35 }
36
__cxa_atexit(void (* destructor)(void *),void * arg,void * dso_handle)37 int __cxa_atexit(void (*destructor)(void *), void *arg, void *dso_handle) {
38 return 0;
39 }
40
__aeabi_atexit(void * arg,void (* func)(void *),void * d)41 int __aeabi_atexit(void *arg, void (*func)(void *), void *d) {
42 return __cxa_atexit(func, arg, d);
43 }
44
45