This is the mail archive of the binutils@sourceware.org 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]

Committed: V850: Fix R_V850_HI16_S overflow handling.


Hi Guys,

  I am applying the patch below to fix a bug with handling of large
  offsets in the R_V850_HI16_S relocation.

Cheers
  Nick

bfd/ChangeLog
2010-01-11  Nick Clifton  <nickc@redhat.com>

	* elf32-v850.c (v850_elf_perform_relocation): Fix overflow
	handling of R_V850_HI16_S relocation.

Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.76
diff -c -3 -p -r1.76 elf32-v850.c
*** bfd/elf32-v850.c	11 Dec 2009 13:42:03 -0000	1.76
--- bfd/elf32-v850.c	11 Jan 2010 12:49:27 -0000
*************** v850_elf_perform_relocation (bfd *abfd,
*** 550,556 ****
        addend = (addend >> 16) + ((addend & 0x8000) != 0);
  
        /* This relocation cannot overflow.  */
!       if (addend > 0x7fff)
  	addend = 0;
  
        insn = addend;
--- 550,556 ----
        addend = (addend >> 16) + ((addend & 0x8000) != 0);
  
        /* This relocation cannot overflow.  */
!       if (addend > 0xffff)
  	addend = 0;
  
        insn = addend;


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