This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS patch to avoid lazy binding in la macros


"Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl> writes:
> > Just to be clear, I'm talking about the gcc mips-3_4-rewrite-branch here.
> > It has two modes: one which uses assembler macros (as current gcc does)
> > and one that uses explicit %reloc() operators.  When using assembler
> > macros, it gets lazy binding by using "jal foo".
> 
>  So what's the problem in the first place?

Well, there are two problems:

1) The assembly sequence I posted is an efficient way of testing
   and calling a weak function.  It works correctly if assembled
   by an irix assembler.

   Now you could say, "well it doesn't work with gas; live with it".
   But IMO this is not really any different from bfd breaking the ABI.
   There have been examples in the past where bfd implemented the
   ABI incorrectly, and it was fixed.

Problem (2) is this...

> > >  Any "la $25,foo" actually as gcc used not to use the register for
> > > anything else when emitting SVR4 PIC code.
> > 
> > Are you sure?  What stopped gcc from using $25 for anything else?
> > Was it declared to be a fixed register?
> 
>  I haven't seen it elsewhere in generated code.  But I can't find it being
> declared a fixed register, either (2.95).  It might have been pure luck
> and I may be wrong, then.

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.

>  Too bad they are not unified diffs -- I have
> hard time reading context diffs bigger than a few lines. 

Hey, I'm not getting into that one ;).

>  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.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]