/* BFD back-end for Motorola 68000 COFF binaries.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 99, 2000
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
#ifdef STATIC_RELOCS
static
#endif
-reloc_howto_type m68kcoff_howto_table[] =
+reloc_howto_type m68kcoff_howto_table[] =
{
HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false),
HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false),
arelent *internal;
int relocentry;
{
- switch (relocentry)
+ switch (relocentry)
{
case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break;
case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break;
#ifdef STATIC_RELOCS
static
#endif
-int
+int
m68k_howto2rtype (internal)
reloc_howto_type *internal;
{
- if (internal->pc_relative)
+ if (internal->pc_relative)
{
- switch (internal->bitsize)
+ switch (internal->bitsize)
{
case 32: return R_PCRLONG;
case 16: return R_PCRWORD;
case 8: return R_PCRBYTE;
}
}
- else
+ else
{
- switch (internal->bitsize)
+ switch (internal->bitsize)
{
case 32: return R_RELLONG;
case 16: return R_RELWORD;
case 8: return R_RELBYTE;
}
}
- return R_RELLONG;
+ return R_RELLONG;
}
#ifdef STATIC_RELOCS
struct coff_link_hash_entry *, struct internal_syment *,
bfd_vma *));
-/*ARGSUSED*/
static reloc_howto_type *
m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
bfd *abfd ATTRIBUTE_UNUSED;
/* coff-m68k.c uses the special COFF backend linker. We need to
adjust common symbols. */
-/*ARGSUSED*/
static reloc_howto_type *
m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
bfd *abfd ATTRIBUTE_UNUSED;
else
{
struct coff_link_hash_entry *h;
-
+
h = obj_coff_sym_hashes (abfd)[irel->r_symndx];
if (h == NULL)
{
struct internal_syment isym;
-
+
bfd_coff_swap_sym_in (abfd, extsyms + symesz * irel->r_symndx,
&isym);
targetsec = coff_section_from_bfd_index (abfd, isym.n_scnum);
else
targetsec = NULL;
}
-
+
bfd_put_32 (abfd,
(irel->r_vaddr - datasec->vma + datasec->output_offset), p);
memset (p + 4, 0, 8);
- strncpy (p + 4, targetsec->output_section->name, 8);
+ if (targetsec != NULL)
+ strncpy (p + 4, targetsec->output_section->name, 8);
}
-
+
return true;
}
#endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS */