fix(cxx): use __cxa_throw() stub in case exceptions disabled

Reduces binary size since the linker will drop some code due to --gc-sections.
This commit is contained in:
Alexey Lapshin
2024-04-25 23:44:22 +04:00
parent 9375348740
commit afffbd9dd0
2 changed files with 15 additions and 1 deletions

View File

@@ -178,4 +178,16 @@ extern "C" _Unwind_Reason_Code __wrap___gxx_personality_v0(int version,
return abort_return<_Unwind_Reason_Code>();
}
// Reduces binary size since the linker will drop some code due to --gc-sections.
extern "C" void __wrap___cxa_allocate_exception(void)
{
abort();
}
// Reduces binary size since the linker will drop some code due to --gc-sections.
extern "C" void __wrap___cxa_throw(void)
{
abort();
}
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS