2.5.2 __rt_entry
The symbol __rt_entry is the starting point for a program using the ARM C library.
Control passes to __rt_entry after all scatter-load regions have been relocated to their
execution addresses.
Usage
The default implementation of __rt_entry :
1. Sets up the heap and stack.
2. Initializes the C library, by calling __rt_lib_init .
3. Calls main() .
4. Shuts down the C library, by calling __rt_lib_shutdown .
5. Exits.
__rt_entry must end with a call to one of the following functions:
exit() Calls atexit()- registered functions and shuts down the library.
__rt_exit() Shuts down the library but does not call atexit() functions.
_sys_exit() Exits directly to the execution environment. It does not shut down the
library and does not call atexit() functions. See _sys_exit() on
page 2-60.
2.5.3 Exiting from the program
The program can exit normally at the end of main() or it can exit prematurely because
of an error.
Exiting from an assert
The behavior of the assert macro depends on the conditions in operation at the most
recent occurrence of #include <assert.h> :
1. If the NDEBUG macro