MIPS assembler branch relaxations

Alexandre Oliva aoliva@redhat.com
Sun Sep 15 00:49:00 GMT 2002


On Sep 14, 2002, Daniel Jacobowitz <drow@mvista.com> wrote:

> If this goes in as-is, I doubt that it'll ever be done the right way. 

I agree.  I doubt it's worth doing it the right way.  It shouldn't
strike often enough to motivate anyone to do it.

> Does it happen inside .set nomacro? [I think so - should it?  I'd
> say not!]

I don't see why not.  It's not like we're expanding a macro.  We're
rather doing relaxation.  Does the linker refrain from doing
relaxations on machine code generated from opcodes assembled while
.set nomacro was in effect?  This is no different, except that the
relaxation is being performed in the assembler rather than in the
linker.

> I think there should be a command-line option to disable this,
> and/or warn about it.

That would be a nice improvement.  Just arrange for whatever option
you come up with to disable this block:

  if (place == NULL
      && address_expr
      && ((*reloc_type == BFD_RELOC_16_PCREL
	   && address_expr->X_op != O_constant)
	  || *reloc_type == BFD_RELOC_16_PCREL_S2)
      && (pinfo & INSN_UNCOND_BRANCH_DELAY || pinfo & INSN_COND_BRANCH_DELAY
	  || pinfo & INSN_COND_BRANCH_LIKELY)
+     && !whatever_option_you_come_up_with
      && !mips_opts.mips16)

This will switch all the rest off.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Binutils mailing list