[PATCH] [SPARC] bfd,ld: Continue after partially-successful relaxed call relocations.

Jose E. Marchesi jose.marchesi@oracle.com
Fri Nov 25 14:10:00 GMT 2016


    
    diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
    index 056a4b7..f191d57 100644
    --- a/bfd/elfxx-sparc.c
    +++ b/bfd/elfxx-sparc.c
    @@ -4122,7 +4122,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
     					  contents + rel->r_offset - 4);
     			  if ((z & (0xffffffff ^ RD(~0)))
     			      != (INSN_OR | RS1(O7) | RS2(G0)))
    -			    break;
    +			    continue;
     
     			  /* The sequence was
     			     or %o7, %g0, %rN
    @@ -4135,7 +4135,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
     			  reg = (y & RS1(~0)) >> 14;
     			  if (reg != ((z & RD(~0)) >> 25)
     			      || reg == G0 || reg == O7)
    -			    break;
    +			    continue;
     
     			  bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP,
     				      contents + rel->r_offset + 4);


LGTM.

This bug has been lurking around since f7775d95.  There used to be a
switch statement between that code and the for loop iterating over the
relocations, hence the breaks.

No regressions in sparc64-linux-gnu.



More information about the Binutils mailing list