summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-21 21:19:43 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-21 21:19:43 +0000
commite3006e038e293a5d52627c9200316acee37ec5fb (patch)
treeec0d2a6217ab4d90504bf764e5f1074fc87089f8 /libc/misc
parentbd22e54f65f260f5ea9591a1a60d1686e7dfd052 (diff)
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.
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/__uClibc_main.c23
1 files changed, 3 insertions, 20 deletions
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);
-}
-