/* The entry function. */ void _start(char **ap, void (*cleanup)(void)) { int argc; char **argv; char **env; argc = *(long *)(void *)ap; argv = ap + 1; env = ap + 2 + argc; handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); else _init_tls(); #ifdef GCRT atexit(_mcleanup); monstartup(&eprol, &etext); __asm__("eprol:"); #endif handle_static_init(argc, argv, env); exit(main(argc, argv, env)); }
/* The entry function, C part. */ void _start1(fptr cleanup, int argc, char *argv[]) { char **env; const char *s; env = argv + argc + 1; environ = env; if (argc > 0 && argv[0] != NULL) { __progname = argv[0]; for (s = __progname; *s != '\0'; s++) if (*s == '/') __progname = s + 1; } if (&_DYNAMIC != NULL) atexit(cleanup); else _init_tls(); #ifdef GCRT atexit(_mcleanup); #endif atexit(_fini); #ifdef GCRT monstartup(&eprol, &etext); __asm__("eprol:"); #endif _init(); exit( main(argc, argv, env) ); }
/* The entry function. */ void __start(int argc, char *argv[], char *env[], void (*cleanup)(void)) { handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); else { /* * Hack to resolve _end so we read the correct symbol. * Without this it will resolve to the copy in the library * that firsts requests it. We should fix the toolchain, * however this is is needed until this can take place. */ *(volatile long *)&_end; _init_tls(); } #ifdef GCRT atexit(_mcleanup); monstartup(&eprol, &etext); __asm__("eprol:"); #endif handle_static_init(argc, argv, env); exit(main(argc, argv, env)); }
/* The entry function. */ void __start(int argc, char *argv[], char *env[], void (*cleanup)(void)) { handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); else _init_tls(); #ifdef GCRT atexit(_mcleanup); monstartup(&eprol, &etext); __asm__("eprol:"); #endif handle_static_init(argc, argv, env); exit(main(argc, argv, env)); }
/* The entry function, C part. */ void _start1(fptr cleanup, int argc, char *argv[]) { char **env; env = argv + argc + 1; handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); else _init_tls(); #ifdef GCRT atexit(_mcleanup); monstartup(&eprol, &etext); __asm__("eprol:"); #endif handle_static_init(argc, argv, env); exit(main(argc, argv, env)); }