v850_elf_add_symbol_hook, v850_elf_link_output_symbol_hook,
v850_elf_section_from_shdr, v850_elf_fake_sections): New functions
(for PR14180) to create and handle special common sections.
+ (v850_elf_final_link_relocate): Fix HI16 and HI16_S relocations
+ which have data stored in the instructions. PR14258.
Tue Dec 2 10:26:16 1997 Nick Clifton <nickc@cygnus.com>
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;
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)
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);