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;
|
*dest++ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* might be provided by platform specific vector.c */
|
||||||
|
pre_main();
|
||||||
|
|
||||||
/* Constructors. */
|
/* Constructors. */
|
||||||
for (fp = &__preinit_array_start; fp < &__preinit_array_end; fp++) {
|
for (fp = &__preinit_array_start; fp < &__preinit_array_end; fp++) {
|
||||||
(*fp)();
|
(*fp)();
|
||||||
@ -82,9 +85,6 @@ void WEAK __attribute__ ((naked)) reset_handler(void)
|
|||||||
(*fp)();
|
(*fp)();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* might be provided by platform specific vector.c */
|
|
||||||
pre_main();
|
|
||||||
|
|
||||||
/* Call the application's entry point. */
|
/* Call the application's entry point. */
|
||||||
main();
|
main();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user