4 * This function takes the raw data block set up by the ELF loader
5 * in the kernel and parses it. It is invoked by crt0.S which makes
6 * any necessary adjustments and passes calls this function using
7 * the standard C calling convention.
10 * uintptr_t *elfdata -- The ELF loader data block; usually from the stack.
11 * Basically a pointer to argc.
12 * void (*onexit)(void) -- Function to install into onexit
18 #include <klibc/compiler.h>
23 extern int main(int, char **, char **);
25 __noreturn __libc_init(uintptr_t *elfdata, void (*onexit)(void))
30 (void)onexit; /* For now, we ignore this... */
32 argc = (int)*elfdata++;
33 argv = (char **)elfdata;
37 exit(main(argc, argv, envp));