This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Fix addend computation of MeP's HI16S reloc.
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Wed, 04 Jul 2007 15:23:05 +0100
- Subject: PATCH: Fix addend computation of MeP's HI16S reloc.
Hi Guys,
I am applying the patch below to fix a bug in the computation of the
addend for the MeP's HI16S reloc. The actual patch was developed by
Richard Henderson a while ago, but it was accidentally omitted when
the MeP port was contributed.
Cheers
Nick
bfd/ChangeLog
2007-07-04 Nick Clifton <nickc@redhat.com>
Import this patch from an internal tree:
2001-07-17 Richard Henderson <rth@redhat.com>
* elf32-mep.c (mep_final_link_relocate) [R_MEP_HI16S]: Correctly
compensate for high bit set in R_MEP_LOW16.
Index: bfd/elf32-mep.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mep.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 elf32-mep.c
*** bfd/elf32-mep.c 3 Jul 2007 14:26:41 -0000 1.6
--- bfd/elf32-mep.c 4 Jul 2007 14:22:31 -0000
*************** mep_final_link_relocate
*** 333,338 ****
--- 333,340 ----
byte[3^e2] = ((u >> 16) & 0xff);
break;
case R_MEP_HI16S: /* ----------------vutsrqponmlkjihg */
+ if (s & 0x8000)
+ s += 0x10000;
byte[2^e2] = ((s >> 24) & 0xff);
byte[3^e2] = ((s >> 16) & 0xff);
break;