MIPS patch to avoid lazy binding in la macros

Richard Sandiford rsandifo@redhat.com
Mon Feb 24 19:21:00 GMT 2003


"Maciej W. Rozycki" <macro@ds2.pg.gda.pl> writes:
>  The assembly sequence is OK, but why not simply make gcc use %reloc() 
> operators for gas and assembler macros for IRIX as?
> [... reordering ..]
>  Frankly, given your %reloc stuff in the trunk I am not that much opposed
> to removing the heuristics anymore, but how about deferring it until after
> 2.14 so that there is a release that can be used either way?  That would
> ease transition a bit. 

Can't really argue against that. ;)

I originally pushed the patch because I thought it was an important
correctness fix.  Current gccs could theoretically trip over the
problem as well.  But I've had great difficulty coming up with a
test case, partly (I think) because $25 comes so late in the GPR
allocation order.

So I agree.  Let's drop the patch for 2.14.  Maybe we can revisit
it after 2.14 branches.  Or maybe we should leave things as-is.

> > 2) We have two conflicting precedents.  On the one hand, gcc treats
> >    $25 as a general temporary register, on the other, gas treats it
> >    as special.  Both are long-standing, but they aren't compatible.
> 
>  But with %reloc() operators the problem goes away, doesn't it?

Yes, it does.

> > >  BTW, why the naming of "%got" vs "%call16" is inconsistent?  I fixed it
> > > in my code -- you could do that, too.
> > 
> > Well, I stuck with the NewABI conventions.  There doesn't seem
> > any point changing to a different name for o32.
> 
>  There is a point, not necessarily for o32 only: how do you express
> something like this (using the notation I used previosly):
> 
> 	la	$25,%call(foo)
> 	jal	%got(bar)
> 
> to get CALL relocations for foo and GOT ones for bar as appropriate for
> the selected ABI and GOT model?  OK, a minor one, though -- they may be
> named say %call_r and %got_r and the NewABI (inconsistent -- who the hell
> does invent that stuff?) conventions be left as is.

This would be more for assembler programmers, right?

GCC really ought to split the la and jal macros up into individual
instructions (rewrite branch does this).  But I can see that
hand-written code might want to use things like 'la ..%call()'
as well, to cater for both the small-GOT and big-GOT casees.

FWIW, your suggestion of %call_r() & %got_r() sounds good to me.

Richard



More information about the Binutils mailing list