diff options
author | Jeff Law <law@redhat.com> | 1996-10-23 21:10:55 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-10-23 21:10:55 +0000 |
commit | 90ffe48b187f4ceedce2a2ad0d9390fc02777ef6 (patch) | |
tree | 73481563c35acdb8e72d29b147a2696cf43b25f5 | |
parent | 84be2a8fa29da1a423d494731b42161d5deba5f5 (diff) | |
download | gdb-90ffe48b187f4ceedce2a2ad0d9390fc02777ef6.zip gdb-90ffe48b187f4ceedce2a2ad0d9390fc02777ef6.tar.gz gdb-90ffe48b187f4ceedce2a2ad0d9390fc02777ef6.tar.bz2 |
* 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.
Still fixing sda/tda/zda stuff.
-rw-r--r-- | bfd/ChangeLog | 17 | ||||
-rw-r--r-- | bfd/elf32-v850.c | 22 |
2 files changed, 28 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index be146a9..d4f7ce4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +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. @@ -9,10 +20,10 @@ start-sanitize-v850 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. diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 8e66789..4c8cc06 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -17,6 +17,12 @@ You should have received a copy of the GNU General Public License 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" @@ -193,7 +199,7 @@ static reloc_howto_type elf_v850_howto_table[] = /* 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 */ @@ -481,7 +487,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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) @@ -491,7 +497,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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) @@ -501,7 +507,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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); @@ -509,7 +515,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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; @@ -523,7 +529,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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; @@ -536,7 +542,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, 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, @@ -629,7 +635,7 @@ elf32_v850_bfd_final_link_relocate (howto, input_bfd, output_bfd, /* 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; |