patches/binutils/2.20/290-ld-stub-crash.patch
changeset 1761 88020b2c3246
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/binutils/2.20/290-ld-stub-crash.patch	Tue Jan 12 19:24:03 2010 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +diff -p -c -u -r1.196 elf32-arm.c
     1.5 +--- a/bfd/elf32-arm.c	22 May 2009 11:58:44 -0000	1.196
     1.6 ++++ b/bfd/elf32-arm.c	12 Jun 2009 13:18:20 -0000
     1.7 +@@ -3175,11 +3175,15 @@ arm_type_of_stub (struct bfd_link_info *
     1.8 + 
     1.9 + 	  /* We have an extra 2-bytes reach because of
    1.10 + 	     the mode change (bit 24 (H) of BLX encoding).  */
    1.11 ++	  /* A stub is needed only if this call is not throught a PLT
    1.12 ++	     entry, because PLT stubs handle mode switching
    1.13 ++	     already.  */
    1.14 + 	  if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
    1.15 + 	      || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
    1.16 +-	      || ((r_type == R_ARM_CALL) && !globals->use_blx)
    1.17 +-	      || (r_type == R_ARM_JUMP24)
    1.18 +-	      || (r_type == R_ARM_PLT32))
    1.19 ++	      || ( (((r_type == R_ARM_CALL) && !globals->use_blx)
    1.20 ++		    || (r_type == R_ARM_JUMP24)
    1.21 ++		    || (r_type == R_ARM_PLT32))
    1.22 ++		   && !use_plt))
    1.23 + 	    {
    1.24 + 	      stub_type = (info->shared | globals->pic_veneer)
    1.25 + 		/* PIC stubs.  */