Beispiel #1
0
/* 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));
}
Beispiel #2
0
/* 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));
}
Beispiel #3
0
/* 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));
}
Beispiel #4
0
/* 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));
}