This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-msmall-data on Alpha
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: gcc at gcc dot gnu dot org
- Date: 27 Apr 2003 03:14:47 +0200
- Subject: -msmall-data on Alpha
Hi,
I'm working on a hairy self-modifying program
(http://fabrice.bellard.free.fr/qemu/), and to keep things simple, I
would like to enforce a single GOT, so the gp always has the same
value. The documentation seems to imply that -msmall-data +
-msmall-text does this. However, even for static functions, a header
to set up the gp from the pv is always emitted:
static int x;
static int f() { return x; }
f:
.frame $30,0,$26,0
ldah $29,0($27) !gpdisp!1
lda $29,0($29) !gpdisp!1
$f..ng:
.prologue 1
ldl $0,x($29) !gprel
ret $31,($26),1
Is that intentional?
Also, for non-static function calls, it seems to be assumed that they
destroy the gp, and it needs to be restored from the return address.
Is that intended? It seems I can work around that by declaring the
function static (even though it is defined elsewhere), but that
doesn't seem very clean...
--
Falk