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]
Other format: [Raw text]

Re: mips: branches to external labels are broken


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


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