make Runtime._syscall() protected so it can be overridden from outside the package
[nestedvm.git] / src / org / ibex / nestedvm / crt0.c
index 7e2c69e..8965c1f 100644 (file)
@@ -8,11 +8,16 @@ extern int atexit(void (*f)());
 extern void _init();
 extern void _fini();
 
+extern char _gp[];
+register char *gp asm("$28");
 char **environ;
     
 void _start(char **argv, char **environ_) {
     int argc;
     
+    if(!gp) gp = _gp;
+    
     environ = environ_;
     
     /* Call global constructors */