init: call pre_main before C++ constructors
This moves the platform specific initialization function pre_main in front of C++ constructors. This is especially necessary for platforms which need to setup the stack pointer (pre_main itself is inline, hence no stack needed for this function).
This commit is contained in:
parent
4c190a3fa3
commit
0d5dac515a
|
@ -74,6 +74,9 @@ void WEAK __attribute__ ((naked)) reset_handler(void)
|
|||
*dest++ = 0;
|
||||
}
|
||||
|
||||
/* might be provided by platform specific vector.c */
|
||||
pre_main();
|
||||
|
||||
/* Constructors. */
|
||||
for (fp = &__preinit_array_start; fp < &__preinit_array_end; fp++) {
|
||||
(*fp)();
|
||||
|
@ -82,9 +85,6 @@ void WEAK __attribute__ ((naked)) reset_handler(void)
|
|||
(*fp)();
|
||||
}
|
||||
|
||||
/* might be provided by platform specific vector.c */
|
||||
pre_main();
|
||||
|
||||
/* Call the application's entry point. */
|
||||
main();
|
||||
|
||||
|
|
Loading…
Reference in New Issue