Datasheet

The C and C++ Libraries
4-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
4.4.2 Exiting from the program
The program can exit normally at the end of
main()
or it can exit prematurely because
of an error. See also:
__rt_entry
__rt_exit() on page 4-23
Tailoring error signaling, error handling, and program exit on page 4-51.
Exiting from an assert
The exit sequence from an assert is:
1.
assert()
prints a message on stderr.
2.
assert()
calls
abort()
.
3.
abort()
calls
__rt_raise()
.
4. If
__rt_raise()
returns,
abort()
tries to finalize the library.
If you are creating an application that does not use the library,
assert()
works if you
retarget
abort()
and the stdio functions.
One solution for retargeting is to retarget the
assert()
function itself. The function
prototype is:
void __assert(const char *expr, const char *file, int line);
where
expr
points to the string representation of the expression that was not
TRUE
file
and
line
identify the source location of the assertion.
4.4.3 __rt_entry
This is not a C function. The symbol
__rt_entry
is the starting point for a program using
the ARM C library.
Implementation
__rt_entry
cannot be implemented in C, because the stack has not been set up at the
point this function is called. Control passes to
__rt_entry
after all scatter-load regions
have been relocated to their execution addresses.