This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH RFA] fix generation of MIPS -membedded-pic jumps
At 07 Feb 2002 17:24:27 -0800, Eric Christopher wrote:
> > value -= symval;
> > - if (value != 0 && ! fixP->fx_pcrel)
> > + if (value != 0
> > + && (! fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2))
> > {
> > /* In this case, the bfd_install_relocation routine will
> > incorrectly add the symbol value back in. We just want
>
> It seems odd that you've got a PCREL reloc with a fixup that's not
> PCREL...
for BFD_RELOC_16_PCREL_S2, fx_pcrel is set.
The code isn't the simplest, i agree.
if (value is not zero)
and ((not pcrel) or (this particular kind of pcrel reloc))
Previously, for fx_r_type == BFD_RELOC_16_PCREL_S2, this block won't
be executed, since (not pcrel) was false.
However, for that particular type of reloc, the block needs to be
executed. ("or at least, it does if we want the final link to produce
the correct output!" 8-)
chris