summaryrefslogtreecommitdiff
path: root/libc/misc/internals/__uClibc_main.c
diff options
context:
space:
mode:
authorDavid McCullough <davidm@snapgear.com>2001-08-09 11:37:33 +0000
committerDavid McCullough <davidm@snapgear.com>2001-08-09 11:37:33 +0000
commitca73e6a5f6856e6a324fb9da004c936709d6fa71 (patch)
treef03f5c13102d06111596624199e323a207f72cf9 /libc/misc/internals/__uClibc_main.c
parent0641a78fd4681a4310843bc41ac2b4853baf48df (diff)
Make sure the weak aliases are defined before the functions/vars
they use as stubs, otherwise, some compilers (ie., m68k-elf) tie them to the local symbols and the weak aliases do not work.
Diffstat (limited to 'libc/misc/internals/__uClibc_main.c')
-rw-r--r--libc/misc/internals/__uClibc_main.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index dc8c62f97..a81448fae 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -19,30 +19,17 @@
*/
extern int main(int argc, char **argv, char **envp);
+extern void __uClibc_empty_func(void);
void __uClibc_main(int argc, char **argv, char **envp)
__attribute__ ((__noreturn__));
-/*
- * Define an empty function and use it as a weak alias for the stdio
- * initialization routine. That way we don't pull in all the stdio
- * code unless we need to. Similarly, do the same for __stdio_close_all
- * so as not to include atexit unnecessarily.
- *
- * NOTE!!! This is only true for the _static_ case!!!
- */
-
-void __uClibc_empty_func(void)
-{
-}
-
#ifdef HAVE_ELF
weak_alias(__environ, environ);
weak_alias(__uClibc_empty_func, __init_stdio);
weak_alias(__uClibc_empty_func, __stdio_close_all);
#endif
-
extern void __init_stdio(void);
extern void __stdio_close_all(void);
@@ -87,6 +74,19 @@ void __uClibc_main(int argc, char **argv, char **envp)
char **__environ = 0;
+/*
+ * Define an empty function and use it as a weak alias for the stdio
+ * initialization routine. That way we don't pull in all the stdio
+ * code unless we need to. Similarly, do the same for __stdio_close_all
+ * so as not to include atexit unnecessarily.
+ *
+ * NOTE!!! This is only true for the _static_ case!!!
+ */
+
+void __uClibc_empty_func(void)
+{
+}
+
#ifndef HAVE_ELF
weak_alias(__environ, environ);
weak_alias(__uClibc_empty_func, __init_stdio);