Usermode/crt0 - Patching to support cross-compiler
authorJohn Hodge <[email protected]>
Tue, 5 Mar 2013 02:00:40 +0000 (10:00 +0800)
committerJohn Hodge <[email protected]>
Tue, 5 Mar 2013 02:00:40 +0000 (10:00 +0800)
Usermode/Libraries/crt0.o_src/crt0.c
Usermode/Libraries/crt0.o_src/crtbegin.c

index f506d72..8363aea 100644 (file)
@@ -6,11 +6,15 @@
 typedef        void    (*exithandler_t)(void);
 typedef        void    (*constructor_t)(void);
 
+constructor_t  _crtbegin_ctors[0] __attribute__((section(".ctors")));
+
 exithandler_t  _crt0_exit_handler;
-extern constructor_t   _crtbegin_ctors[];
+//extern constructor_t _crtbegin_ctors[];
 extern void    _exit(int status) __attribute__((noreturn));
 extern int     main(int argc, char *argv[], char **envp);
 
+void _start(int argc, char *argv[], char **envp) __attribute__ ((alias("start")));
+
 void start(int argc, char *argv[], char **envp)
 {
         int    i;
index 8e18f89..e69de29 100644 (file)
@@ -1,2 +0,0 @@
-
-void   *_crtbegin_ctors[0] __attribute__((section(".ctors")));

UCC git Repository :: git.ucc.asn.au