#include <stdarg.h>
#include <pthread.h>
#include <Availability.h>
+#include <mach-o/dyld_priv.h>
-#include "mach-o/dyld_priv.h"
#include "dyldLibSystemInterface.h"
+
extern void _ZN4dyld3logEPKcz(const char*, ...);
extern struct LibSystemHelpers* _ZN4dyld17gLibSystemHelpersE;
}
char* data = (char*)_ZN4dyld17gLibSystemHelpersE->pthread_getspecific(sCxaKey);
if ( data == NULL ) {
- data = calloc(2,sizeof(void*));
+ long* t = (long*)calloc(2,sizeof(long));
+ data = (char*)t;
_ZN4dyld17gLibSystemHelpersE->pthread_setspecific(sCxaKey, data);
}
return data;
-
-#if !__arm__
+#if !__USING_SJLJ_EXCEPTIONS__
//
-// The intel versions of dyld uses zero-cost exceptions which are handled by
-// linking with a special copy of libunwind.a
+// When dyld uses zero-cost exceptions it just needs to implement
+// _dyld_find_unwind_sections to return sections inside dyld proper.
//
extern void* ehStart __asm("section$start$__TEXT$__eh_frame");
}
}
-#endif // !__arm__
-
-
-#if __arm__
+#else
+//
+// When dyld uses setjump-longjump exceptions it needs to implement
+// routines to push and pop a stack of _Unwind_FunctionContext.
+//
struct _Unwind_FunctionContext
{