This does not apply to ARMv6-M and ARMv7-M profiles.
In general, it is beneficial to separate all system initialization code from the main application. However, some components of system initialization, for example, enabling of caches and interrupts, must occur after executing C library initialization code.
You can make use of the
wrapper symbols to insert a routine that is executed immediately
before entering the main application. This mechanism enables you
to extend functions without altering the source code.
The following example shows how
be used in this way:
The linker replaces the function call to
a call to
$Sub$$main(). From there you can call
a routine that enables caches and another to enable interrupts.
The code branches to the real