From: brian Date: Mon, 22 May 2006 08:03:05 +0000 (-0700) Subject: automatically set gp register X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=commitdiff_plain;h=7d260c5822b8e63f198b52b24018fc7f19735692 automatically set gp register darcs-hash:20060522080305-24bed-4fe83c225bfc06a4bbc43fdb935811b7d07d8d15.gz --- 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 */