summaryrefslogtreecommitdiff
path: root/libc/misc/internals
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-28 23:44:06 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-05-28 23:44:06 +0000
commitd1b0dffff4be58782a15ebec6595de2447f63dc2 (patch)
treed07c74419c3531984ae620899fc9a0e9cf892797 /libc/misc/internals
parent83bb7f2166ccec164942b010130b285676d7cf3b (diff)
Add Peter Mazinger fini/crt compat patch. Select DL_FINI_CRT_COMPAT to
be able to run apps built with 0.9.27. This also renames __uClibc_start_main to __uClibc_main. This compat option should be removed some time after 0.9.28 is released. Let me know if you don't like this change.
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/__uClibc_main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 69a03d345..071d6d613 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -164,7 +164,7 @@ void attribute_hidden (*__rtld_fini)(void) = NULL;
* are initialized, just before we call the application's main function.
*/
void __attribute__ ((__noreturn__))
-__uClibc_start_main(int (*main)(int, char **, char **), int argc,
+__uClibc_main(int (*main)(int, char **, char **), int argc,
char **argv, void (*app_init)(void), void (*app_fini)(void),
void (*rtld_fini)(void), void *stack_end)
{
@@ -253,3 +253,13 @@ __uClibc_start_main(int (*main)(int, char **, char **), int argc,
*/
exit(main(argc, argv, __environ));
}
+
+#ifdef _DL_FINI_CRT_COMPAT
+extern int weak_function main(int argc, char **argv, char **envp);
+void __attribute__ ((__noreturn__))
+__uClibc_start_main(int argc, char **argv, char **envp,
+ void (*app_fini)(void), void (*app_init)(void))
+{
+ __uClibc_main(main, argc, argv, app_init, app_fini, NULL, NULL);
+}
+#endif