return bfd_reloc_notsupported;
case R_V850_22_PCREL:
- if (relocation > 0x1ffff || relocation < -0x200000)
+ if (relocation > 0x1fffff || relocation < -0x200000)
return bfd_reloc_overflow;
if ((relocation % 2) != 0)
+ input_section->output_offset);
value -= offset;
- if ((long)value > 0x1ffff || (long)value < -0x200000)
+ if ((long)value > 0x1fffff || (long)value < -0x200000)
return bfd_reloc_overflow;
if ((value % 2) != 0)
value = (value >> 16) + ((value & 0x8000) != 0);
if ((long)value > 0x7fff || (long)value < -0x8000)
- return bfd_reloc_overflow;
+ {
+ /* This relocation cannot overflow. */
+
+ value = 0;
+ }
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
value += (short)bfd_get_16 (input_bfd, hit_data);
value >>= 16;
- if ((long)value > 0x7fff || (long)value < -0x8000)
- return bfd_reloc_overflow;
-
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
+ h->u.def.section->output_offset);
value -= ep;
- value += ((insn & 0x7e) << 2);
+ value += ((insn & 0x7e) << 1);
if ((long) value > 0xfc || (long) value < 0)
return bfd_reloc_overflow;
h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true);
if (h == (struct bfd_link_hash_entry *) NULL
|| h->type != bfd_link_hash_defined)
- return bfd_reloc_continue; /* Actually this indicates that __ctbp could not be found. */
+ return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */
ctbp = (h->u.def.value
+ h->u.def.section->output_section->vma
h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true);
if (h == (struct bfd_link_hash_entry *) NULL
|| h->type != bfd_link_hash_defined)
- return bfd_reloc_other;
+ return (bfd_reloc_dangerous + 1);
ctbp = (h->u.def.value
+ h->u.def.section->output_section->vma
relocation = (h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset);
+#if 0
+fprintf (stderr, "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
+ sec->name, h->root.root.string, h->root.u.def.value, sec->output_section->vma, sec->output_offset, relocation);
+#endif
}
else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
+ {
+#if 0
+fprintf (stderr, "undefined: sec: %s, name: %s\n",
+ sec->name, h->root.root.string);
+#endif
+ relocation = 0;
+ }
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section, rel->r_offset)))
return false;
+#if 0
+fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
+#endif
relocation = 0;
}
}
break;
case bfd_reloc_undefined:
- fprintf (stderr, "undef2 %s\n", name );
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
rel->r_offset)))
msg = "could not locate special linker symbol __ep";
goto common_error;
+ case (bfd_reloc_dangerous + 1):
+ msg = "could not locate special linker symbol __ctbp";
+ goto common_error;
+
default:
msg = "internal error: unknown error";
/* fall through */