This is the library initialization function and is the companion to __rt_lib_shutdown().
extern value_in_regs struct __argc_argv __rt_lib_init(unsigned heapbase, unsigned heaptop);
where:
heapbaseThe start of the heap memory block.
heaptopThe end of the heap memory block.
This is the library initialization function. It is called immediately after __rt_stackheap_init() and passed an initial chunk of memory to use as a heap. This function is the standard ARM library initialization function and must not be re‑implemented.
The function returns argc and argv ready to be passed to main(). The structure is returned in the registers as:
struct __argc_argv
{
int argc;
char **argv;
int r2, r3;
};