- int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
- word and the pc's been incremented. */
-
- if (gap & 1)
- abort ();
- gap /= 2;
- if (gap > 127 || gap < -128)
- (*link_info->callbacks->reloc_overflow)
- (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
- reloc->howto->name, reloc->addend, input_section->owner,
- input_section, reloc->address);
-
- bfd_put_8 (in_abfd, gap, data + *dst_ptr);
- (*dst_ptr)++;
- (*src_ptr)++;
+ /* -1, since we're in the odd byte of the word and the pc has
+ been incremented. */
+ bfd_signed_vma gap = dst - dot - 1;
+
+ if ((gap & 1) != 0 || gap > 254 || gap < -256)
+ {
+ link_info->callbacks->reloc_overflow
+ (link_info, NULL, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ reloc->howto->name, reloc->addend, input_section->owner,
+ input_section, reloc->address);
+ return false;
+ }
+
+ bfd_put_8 (in_abfd, gap / 2, data + *dst_ptr);
+ *dst_ptr += 1;
+ *src_ptr += 1;