Release 2.22: branch create

Eric Botcazou ebotcazou@adacore.com
Mon Oct 17 09:33:00 GMT 2011


> Eric, could you please test this patch?  GOLD had the same exact bug so I
> fixed it there too.
>
> bfd/
>
> 	PR binutils/13301
> 	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Always move the
> 	__tls_get_addr call delay slot instruction forward 4 bytes when
> 	performing relaxation.

Not sufficient it seems, you also need to move the potential relocation of the 
insn in the delay slot.  The example I have is:

   0x00014188 <+232>:   add  %g7, %o0, %o0
   0x0001418c <+236>:   sethi  %hi(0), %l0
   0x00014190 <+240>:   ld  [ %o0 ], %g1

before the change and:

   0x00014188 <+232>:   sethi  %hi(0), %l0
   0x0001418c <+236>:   add  %g0, %g0, %o0
   0x00014190 <+240>:   ld  [ %o0 ], %g1

after, because of a R_SPARC_TLS_GD_HI22 relocation attached to the insn.

-- 
Eric Botcazou



More information about the Binutils mailing list