From e3006e038e293a5d52627c9200316acee37ec5fb Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Sat, 21 May 2005 21:19:43 +0000 Subject: Pass main function ptr from crt1 to __uClibc_start_main. Kill old crt0/__uClibc_main. This breaks ABI. All apps and toolchain needs to be recompiled. All archs except x86 are now broken and need to be fixed as x86. PPC will be fixed shortly by me, the rest is left to the arch maintainers. --- libc/misc/internals/__uClibc_main.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'libc/misc') diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index a33e6fe4a..70dc07328 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -32,7 +32,6 @@ extern void __guard_setup(void); /* * Prototypes. */ -extern int main(int argc, char **argv, char **envp); extern void weak_function _stdio_init(void); extern int *weak_const_function __errno_location(void); extern int *weak_const_function __h_errno_location(void); @@ -166,7 +165,9 @@ void attribute_hidden (*__rtld_fini)(void) = NULL; */ void __attribute__ ((__noreturn__)) __uClibc_start_main(int argc, char **argv, char **envp, - void (*app_init)(void), void (*app_fini)(void), void (*rtld_fini)(void)) + void (*app_init)(void), void (*app_fini)(void), + int (*main)(int argc, char **argv, char **envp), + void (*rtld_fini)(void)) { #ifdef __ARCH_HAS_MMU__ unsigned long *aux_dat; @@ -249,21 +250,3 @@ __uClibc_start_main(int argc, char **argv, char **envp, */ exit(main(argc, argv, envp)); } - - -/* __uClibc_main is the old main stub of the uClibc. This - * function is called from crt0 (uClibc 0.9.15 and older) after - * ALL shared libraries are initialized, and just before we call - * the application's main() function. - * - * Attention: This stub does not call the .init/.fini sections of - * the application. If you need this, please fix your uClibc port - * so that __uClibc_start_main is called by your crt0.S with - * _init and _fini properly set. -*/ -void __attribute__ ((__noreturn__)) -__uClibc_main(int argc, char **argv, char ** envp) -{ - __uClibc_start_main(argc, argv, envp, NULL, NULL, NULL); -} - -- cgit v1.2.3