From 7d260c5822b8e63f198b52b24018fc7f19735692 Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 22 May 2006 01:03:05 -0700 Subject: [PATCH] automatically set gp register darcs-hash:20060522080305-24bed-4fe83c225bfc06a4bbc43fdb935811b7d07d8d15.gz --- src/org/ibex/nestedvm/crt0.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ -- 1.7.10.4