Skip to content

Commit

Permalink
squash 'Add more Unwind symbols' (implemented functions globally)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuke committed Apr 8, 2021
1 parent e19b19e commit 3eb8312
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
7 changes: 6 additions & 1 deletion repos/base/lib/mk/cxx.mk
Expand Up @@ -23,7 +23,12 @@ LOCAL_CXX_SYMBOLS += _Znam _Znwm
#
# Symbols we wrap (see unwind.cc)
#
EH_SYMBOLS = _Unwind_Resume _Unwind_Complete _Unwind_DeleteException
EH_SYMBOLS = _Unwind_Resume _Unwind_Complete _Unwind_DeleteException \
_Unwind_Backtrace _Unwind_GetDataRelBase _Unwind_GetIPInfo \
_Unwind_GetLanguageSpecificData _Unwind_GetRegionStart \
_Unwind_GetTextRelBase _Unwind_RaiseException \
_Unwind_Resume_or_Rethrow _Unwind_SetGR _Unwind_SetIP


#
# Additional functions for ARM
Expand Down
54 changes: 54 additions & 0 deletions repos/base/src/lib/cxx/unwind.c
Expand Up @@ -29,6 +29,60 @@ void _cxx__Unwind_DeleteException(void *exc) __attribute__((weak));
void _Unwind_DeleteException(void *exc) {
_cxx__Unwind_DeleteException(exc); }


/* Unwind functions used by language runtimes. e.g. libgo */

void *_cxx__Unwind_GetTextRelBase(void *ctx) __attribute__((weak));
void *_Unwind_GetTextRelBase(void *ctx) {
return _cxx__Unwind_GetTextRelBase(ctx); }


int _cxx__Unwind_Resume_or_Rethrow(void *exc) __attribute__((weak));
int _Unwind_Resume_or_Rethrow(void *exc) {
return _cxx__Unwind_Resume_or_Rethrow(exc); }


int _cxx__Unwind_RaiseException(void *exc) __attribute__((weak));
int _Unwind_RaiseException(void *exc) {
return _cxx__Unwind_RaiseException(exc); }


void *_cxx__Unwind_GetLanguageSpecificData(void *ctx) __attribute__((weak));
void *_Unwind_GetLanguageSpecificData(void *ctx) {
return _cxx__Unwind_GetLanguageSpecificData(ctx); }


typedef int (*trace_fn)(void *, void *);
int _cxx__Unwind_Backtrace(trace_fn fn, void *) __attribute__((weak));
int _Unwind_Backtrace(trace_fn fn, void *arg) {
return _cxx__Unwind_Backtrace(fn, arg); }


void *_cxx__Unwind_GetIPInfo(void *ctx, int *info) __attribute__((weak));
void *_Unwind_GetIPInfo(void *ctx, int *info) {
return _cxx__Unwind_GetIPInfo(ctx, info); }


void _cxx__Unwind_SetGR(void *ctx, int index, unsigned val) __attribute__((weak));
void _Unwind_SetGR(void *ctx, int index, unsigned val) {
return _cxx__Unwind_SetGR(ctx, index, val); }


void _cxx__Unwind_SetIP(void *ctx, void *ptr) __attribute__((weak));
void _Unwind_SetIP(void *ctx, void *ptr) {
return _cxx__Unwind_SetIP(ctx, ptr); }


void *_cxx__Unwind_GetRegionStart(void *ctx) __attribute__((weak));
void *_Unwind_GetRegionStart(void *ctx) {
return _cxx__Unwind_GetRegionStart(ctx); }


void *_cxx__Unwind_GetDataRelBase(void *ctx) __attribute__((weak));
void *_Unwind_GetDataRelBase(void *ctx) {
return _cxx__Unwind_GetDataRelBase(ctx); }


/* Special ARM-EABI personality functions */
#ifdef __ARM_EABI__

Expand Down

0 comments on commit 3eb8312

Please sign in to comment.