This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mips: branches to external labels are broken
- From: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 26 Nov 2002 05:18:23 +0100
- Subject: Re: mips: branches to external labels are broken
- References: <orvg2lrpoe.fsf@free.redhat.lsd.ic.unicamp.br>
Alexandre Oliva wrote:
[snip]
> If we were to accept branches to external
> labels, we should use the extension that was come up with for Embedded
> PIC, but I'm not convinced we should do it, since there's really no
> benefit in being able to branch to external symbols, since you can
> hardly guarantee they're going to be in range.
I added some support for branches to external labels for two reasons:
- to support what the spec wants
- to allow carefully optimized assembly code
If it gets in the way of a clean relocation handling rewrite, that's
probably reason enough to remove it.
[snip]
> @@ -11286,15 +11262,12 @@ md_apply_fix3 (fixP, valP, seg)
> as_bad_where (fixP->fx_file, fixP->fx_line,
> _("Branch to odd address (%lx)"), (long) value);
>
> - /* Fall through. */
> -
> - case BFD_RELOC_16_PCREL:
> /*
> * We need to save the bits in the instruction since fixup_segment()
> * might be deleting the relocation entry (i.e., a branch within
> * the current segment).
> */
> - if (!fixP->fx_done && value != 0)
> + if (!fixP->fx_done && (value != 0 || HAVE_NEWABI))
> break;
Is HAVE_NEWABI the right check here? !EMBEDDED_PIC might be better.
Thiemo