+start-sanitize-v850
+Wed Oct 23 00:53:16 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c: Add comments about assumptions about
+ char, short & long sizes.
+ (elf32_v850_bfd_final_link_relocate): Fix sign extension
+ problems for several relocs.
+
+ * elf32-v850.c (elf32_v850_howto_table): Fix typo in
+ R_V850_SDA_OFFSET entry.
+
Wed Oct 23 00:20:34 1996 Ian Lance Taylor <ian@cygnus.com>
* xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym.
Tue Oct 22 19:20:38 1996 Jeffrey A Law (law@cygnus.com)
* elf32-v850.c (elf_v850_howto_table): Fix ordering of
- R_V850_ZDAOFFSET and R_V850_TDAOFFSET. Fix various
- fields in R_V850_TDAOFFSET.
+ R_V850_ZDA_OFFSET and R_V850_TDA_OFFSET. Fix various
+ fields in R_V850_TDA_OFFSET.
(elf32_v850_bfd_final_link_relocate): Tweak pc-relative
- relocs to work more like other relocs. Handle R_V850_TDAOFF
+ relocs to work more like other relocs. Handle R_V850_TDA_OFFSET
relocations.
* elf32-v850.c: Include bfdlink.h.
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+/* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char
+ dependencies. As is the gas & simulator code or the v850. */
+
+
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
/* Offset from the short data area pointer. */
HOWTO (R_V850_SDA_OFFSET, /* type */
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
return bfd_reloc_ok;
case R_V850_HI16_S:
- value += bfd_get_16 (input_bfd, hit_data);
+ value += (short)bfd_get_16 (input_bfd, hit_data);
value = (value >> 16) + ((value & 0x8000) != 0);
if ((long)value > 0x7fff || (long)value < -0x8000)
return bfd_reloc_ok;
case R_V850_HI16:
- value += bfd_get_16 (input_bfd, hit_data);
+ value += (short)bfd_get_16 (input_bfd, hit_data);
value >>= 16;
if ((long)value > 0x7fff || (long)value < -0x8000)
return bfd_reloc_ok;
case R_V850_LO16:
- value += bfd_get_16 (input_bfd, hit_data);
+ value += (short)bfd_get_16 (input_bfd, hit_data);
value &= 0xffff;
bfd_put_16 (input_bfd, value, hit_data);
case R_V850_16:
case R_V850_ZDA_OFFSET:
- value += bfd_get_16 (input_bfd, hit_data);
+ value += (short)bfd_get_16 (input_bfd, hit_data);
if ((long)value > 0x7fff || (long)value < -0x8000)
return bfd_reloc_overflow;
return bfd_reloc_ok;
case R_V850_8:
- value += bfd_get_8 (input_bfd, hit_data);
+ value += (char)bfd_get_8 (input_bfd, hit_data);
if ((long)value > 0x7f || (long)value < -0x80)
return bfd_reloc_overflow;
unsigned long gp;
struct bfd_link_hash_entry *h;
- value += bfd_get_16 (input_bfd, hit_data);
+ value += (short)bfd_get_16 (input_bfd, hit_data);
/* Get the value of __gp. */
h = bfd_link_hash_lookup (info->hash, "__gp", false,
/* Guess (XXX) that it's a movea instruction or something
similar. */
- value += insn;
+ value += (short)insn;
if ((long)value > 0x7fff || (long)value < -0x8000)
return bfd_reloc_overflow;