Merge branch 'feature/cxx_exceptions' into 'master'

Partial support for C++ exceptions

See merge request !930
pull/846/merge
Ivan Grokhotkov 2017-09-01 00:27:41 +08:00
commit d4e950d311
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -94,6 +94,10 @@ extern volatile int port_xSchedulerRunning[2];
static const char* TAG = "cpu_start"; static const char* TAG = "cpu_start";
struct object { long placeholder[ 10 ]; };
void __register_frame_info (const void *begin, struct object *ob);
extern char __eh_frame[];
/* /*
* We arrive here after the bootloader finished loading the program from flash. The hardware is mostly uninitialized, * We arrive here after the bootloader finished loading the program from flash. The hardware is mostly uninitialized,
* and the app CPU is in reset. We do have a stack, so we can do the initialization in C. * and the app CPU is in reset. We do have a stack, so we can do the initialization in C.
@ -334,6 +338,9 @@ void start_cpu1_default(void)
static void do_global_ctors(void) static void do_global_ctors(void)
{ {
static struct object ob;
__register_frame_info( __eh_frame, &ob );
void (**p)(void); void (**p)(void);
for (p = &__init_array_end - 1; p >= &__init_array_start; --p) { for (p = &__init_array_end - 1; p >= &__init_array_start; --p) {
(*p)(); (*p)();

Wyświetl plik

@ -154,11 +154,13 @@ SECTIONS
*(.rodata1) *(.rodata1)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.); __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table) *(.xt_except_table)
*(.gcc_except_table) *(.gcc_except_table .gcc_except_table.*)
*(.gnu.linkonce.e.*) *(.gnu.linkonce.e.*)
*(.gnu.version_r) *(.gnu.version_r)
*(.eh_frame)
. = (. + 3) & ~ 3; . = (. + 3) & ~ 3;
__eh_frame = ABSOLUTE(.);
KEEP(*(.eh_frame))
. = (. + 7) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */ /* C++ constructor and destructor tables, properly ordered: */
__init_array_start = ABSOLUTE(.); __init_array_start = ABSOLUTE(.);
KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin.o(.ctors))