X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2Fcrt0.c;h=8965c1fa1f94bcd613207cfd1af32a3be12ec3d3;hp=7e2c69e9fd16aec18be992483430e7c0bdf71795;hb=bde3f4baced21ef9d19907d74401196e6c3d2467;hpb=960bb4430543bc48cdb46e5ad49afc24bfa04f3b diff --git a/src/org/ibex/nestedvm/crt0.c b/src/org/ibex/nestedvm/crt0.c index 7e2c69e..8965c1f 100644 --- a/src/org/ibex/nestedvm/crt0.c +++ b/src/org/ibex/nestedvm/crt0.c @@ -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 */