X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=klibc%2Fklibc%2F__static_init.c;h=0b59eedaa73260b11616f3df5aca9fc391f5ae56;hb=a0622777688ad84ef3d789e0171cfb0ca3dc21d2;hp=5a90b5cd88a95303b772a51ea31ac34ab3faa7d5;hpb=9e8a3a095d955538acbdf28dba02582f6b2330e5;p=elogind.git diff --git a/klibc/klibc/__static_init.c b/klibc/klibc/__static_init.c index 5a90b5cd8..0b59eedaa 100644 --- a/klibc/klibc/__static_init.c +++ b/klibc/klibc/__static_init.c @@ -1,38 +1,2 @@ -/* - * __static_init.c - * - * This function takes the raw data block set up by the ELF loader - * in the kernel and parses it. It is invoked by crt0.S which makes - * any necessary adjustments and passes calls this function using - * the standard C calling convention. - * - * The arguments are: - * uintptr_t *elfdata -- The ELF loader data block; usually from the stack. - * Basically a pointer to argc. - * void (*onexit)(void) -- Function to install into onexit - */ - -#include -#include -#include -#include -#include - -char **environ; - -extern int main(int, char **, char **); - -__noreturn __libc_init(uintptr_t *elfdata, void (*onexit)(void)) -{ - int argc; - char **argv, **envp; - - (void)onexit; /* For now, we ignore this... */ - - argc = (int)*elfdata++; - argv = (char **)elfdata; - envp = argv+(argc+1); - - environ = envp; - exit(main(argc, argv, envp)); -} +#define SHARED 0 +#include "libc_init.c"