diff options
author | Nick Clifton <nickc@redhat.com> | 1997-12-06 00:57:20 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 1997-12-06 00:57:20 +0000 |
commit | 0a5875fc63c256f0daa9db6ed9a35257ab3db247 (patch) | |
tree | 30c329831c5613dd4c1a208601457082e2b6bf2a /bfd/elf32-v850.c | |
parent | e0f7db023dab750e868be6d3fd101b65d5dd7fdc (diff) | |
download | fsf-binutils-gdb-0a5875fc63c256f0daa9db6ed9a35257ab3db247.zip fsf-binutils-gdb-0a5875fc63c256f0daa9db6ed9a35257ab3db247.tar.gz fsf-binutils-gdb-0a5875fc63c256f0daa9db6ed9a35257ab3db247.tar.bz2 |
Fix HI16 and HI16_S relocations for PR14258
Diffstat (limited to 'bfd/elf32-v850.c')
-rw-r--r-- | bfd/elf32-v850.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 8e5acf6..36fc38d 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -691,13 +691,13 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace) break; case R_V850_HI16_S: - addend += bfd_get_16 (abfd, address); + addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16) + ((addend & 0x8000) != 0); insn = addend; break; case R_V850_HI16: - addend += bfd_get_16 (abfd, address); + addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16); insn = addend; break; @@ -1009,7 +1009,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_V850_HI16_S: - value += (short)bfd_get_16 (input_bfd, hit_data); + value += (bfd_get_16 (input_bfd, hit_data) << 16); value = (value >> 16) + ((value & 0x8000) != 0); if ((long)value > 0x7fff || (long)value < -0x8000) @@ -1023,7 +1023,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_V850_HI16: - value += (short)bfd_get_16 (input_bfd, hit_data); + value += (bfd_get_16 (input_bfd, hit_data) << 16); value >>= 16; bfd_put_16 (input_bfd, value, hit_data); |