Implement stub functions

This commit is contained in:
topjohnwu 2024-02-24 03:41:03 -08:00
parent 06b6fb0c33
commit e9980c778b
2 changed files with 11 additions and 0 deletions

View File

@ -13,6 +13,7 @@ ifdef B_INIT
# Disable all security and debugging features # Disable all security and debugging features
APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -U_FORTIFY_SOURCE APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -U_FORTIFY_SOURCE
APP_LDFLAGS += -Wl,-wrap,abort_message
# Override output folder to make sure all dependencies are rebuilt with new CFLAGS # Override output folder to make sure all dependencies are rebuilt with new CFLAGS
NDK_APP_OUT := ./obj/init NDK_APP_OUT := ./obj/init

View File

@ -151,3 +151,13 @@ char *basename(const char *path) {
int rc = __basename_r(path, buf, sizeof(buf)); int rc = __basename_r(path, buf, sizeof(buf));
return (rc < 0) ? NULL : buf; return (rc < 0) ? NULL : buf;
} }
// Simply just abort when abort_message is called
void __wrap_abort_message(const char* format, ...) {
abort();
}
// Don't care about C++ global destructors
int __cxa_atexit(void (*func) (void *), void * arg, void * dso_handle) {
return 0;
}