relax jalr $t9 [R_MIPS_JALR symbol] to bal symbol

cgd@broadcom.com cgd@broadcom.com
Tue Mar 25 07:03:00 GMT 2003


At Tue, 25 Mar 2003 03:58:53 +0000 (UTC), "Richard Henderson" wrote:
> > > Secondly, as a follow-up patch I think that !link_info->shared
> > > should make use of the j/jal absolute forms.
> > 
> > You mean, if the branch is out of range, or even if it would be in range?
> 
> Um, I dunno.  I suspect that bal will never be slower than jal
> on any implementation; it's not impossible that the reverse is
> not true.  Anyone know how this affects Real Life Implementations?

I'm not aware of any implementations in which jal is slower than bal,
but my experience isn't that comprehensive, really.

Due to the way they're done on MIPS, in fact, i believe the
destination of the bal is "harder" to calculate than the destination
address of the jump...  (bal requires addition, whereas jal takes the
upper N bits of the delay slot insn PC and ORs in the index in the
jump instruction.)


This brings to mind a random question:

Is there something in the dynamic loader that makes sure that the
"index in segment" aspect of mips jumps will be handled sanely?

I can imagine some ... fairly pathological cases (w/ n64) in which a
given shared object is mapped crossing a 256MB boundary, screwing up
jumps entirely...  8-)



cgd



More information about the Binutils mailing list