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]

Re: 2.10.91: A problem with R_MIPS_CALL relocations within gas


   Date: Fri, 17 Nov 2000 11:02:59 -0800
   From: Josh Scheid <jscheid@SandCraft.com>

   On Fri, Nov 17, 2000 at 10:40:18AM -0800, Josh Scheid wrote:
   > >    Date: Fri, 17 Nov 2000 18:11:21 +0100 (MET)
   > >    From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
   > > 
   > >    Gcc however prefers to
   > >    generate code like the following:
   > > 
   > >    la $25,<symbol>
   > >    jalr $25
   > > 
   > >    possibly because there are problems with other MIPS assemblers.
   > 
   > On Fri, Nov 17, 2000 at 09:16:52AM -0800, Ian Lance Taylor wrote:
   > > FYI, gcc does this to permit better instruction scheduling.  Splitting
   > > up the instructions permits, e.g., putting the la instruction in a
   > > delay slot.  Other MIPS toolchains do extensive instruction scheduling
   > > in the assembler, but in the GNU toolchain gcc can do a better job of
   > > that.
   > 
   > What "LA" instruction?
   > 
   > I guess if all your symbols are under 0x00010000, LA 

   Oops, didn't complete my thought.  LA is not an actual MIPS instruction, but 
   an assembler tool that may become replaced with multiple instructions.  The
   following won't work for all cases if you expect the LA to be complete when
   execution gets to LabelFoo.

     beq   $0, $0, LabelFoo
     la    $1, <LabelBar>

True, gcc needs to break up the la as well.  It is able to do that
using -msplit-addresses.  I don't know whether it does or not in this
specific example.

Ian

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