/* BFD back-end for Hitachi H8/300 COFF binaries.
- Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
/* Turn a howto into a reloc number */
#define SELECT_RELOC(x,howto) \
- { x = select_reloc(howto); }
+ { x.r_type = select_reloc(howto); }
#define BADMAG(x) (H8300BADMAG(x)&& H8300HBADMAG(x))
#define H8300 1 /* Customize coffcode.h */
reloc_processing(relent, reloc, symbols, abfd, section)
static void
-DEFUN (reloc_processing, (relent, reloc, symbols, abfd, section),
- arelent * relent AND
- struct internal_reloc *reloc AND
- asymbol ** symbols AND
- bfd * abfd AND
- asection * section)
+reloc_processing (relent, reloc, symbols, abfd, section)
+ arelent * relent;
+ struct internal_reloc *reloc;
+ asymbol ** symbols;
+ bfd * abfd;
+ asection * section;
{
relent->address = reloc->r_vaddr;
rtype2howto (relent, reloc);
static int
-h8300_reloc16_estimate(input_section, symbols, reloc, shrink, link_info)
+h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info)
+ bfd *abfd;
asection *input_section;
- asymbol **symbols;
arelent *reloc;
unsigned int shrink;
struct bfd_link_info *link_info;
/* The place to relc moves back by one */
/* This will be two bytes smaller in the long run */
shrink +=2 ;
- bfd_perform_slip(symbols, 2, input_section, address);
+ bfd_perform_slip(abfd, 2, input_section, address);
}
break;
reloc->howto = reloc->howto + 1;
/* This will be two bytes smaller in the long run */
shrink +=2 ;
- bfd_perform_slip(symbols, 2, input_section, address);
+ bfd_perform_slip(abfd, 2, input_section, address);
}
break;
/* This will be two bytes smaller in the long run */
shrink +=2 ;
- bfd_perform_slip(symbols, 2, input_section, address);
+ bfd_perform_slip(abfd, 2, input_section, address);
}
break;
}
dst_address++;
src_address++;
+ break;
+ }
+ case R_PCRWORD:
+ {
+ bfd_vma dot = link_order->offset
+ + dst_address
+ + link_order->u.indirect.section->output_section->vma;
+ int gap = (bfd_coff_reloc16_get_value (reloc, link_info, input_section)
+ - dot) + 1;
+ if (gap > 32767 || gap < -32768)
+ {
+ if (! ((*link_info->callbacks->reloc_overflow)
+ (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ reloc->howto->name, reloc->addend, input_section->owner,
+ input_section, reloc->address)))
+ abort ();
+ }
+
+ bfd_put_16 (abfd, gap, data + dst_address);
+ dst_address+=2;
+ src_address+=2;
+
break;
}
/* BFD back-end for Hitachi H8/500 COFF binaries.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1994 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
static reloc_howto_type r_high8 =
HOWTO (R_H8500_HIGH8, 0, 1, 8, false, 0,
- complain_overflow_bitfield, 0, "r_high8", true, 0x000000ff, 0x000000ff, false);
+ complain_overflow_dont, 0, "r_high8", true, 0x000000ff, 0x000000ff, false);
static reloc_howto_type r_low16 =
HOWTO (R_H8500_LOW16, 0, 1, 16, false, 0,
- complain_overflow_bitfield, 0, "r_low16", true, 0x0000ffff, 0x0000ffff, false);
+ complain_overflow_dont, 0, "r_low16", true, 0x0000ffff, 0x0000ffff, false);
static reloc_howto_type r_pcrel8 =
HOWTO (R_H8500_PCREL8, 0, 1, 8, true, 0, complain_overflow_signed, 0, "r_pcrel8", true, 0, 0, true);
static reloc_howto_type r_high16 =
HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0,
- complain_overflow_bitfield, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false);
+ complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false);
/* Turn a howto into a reloc number */
return howto->type;
}
-#define SELECT_RELOC(x,howto) x= coff_h8500_select_reloc(howto)
+#define SELECT_RELOC(x,howto) x.r_type = coff_h8500_select_reloc(howto)
#define BADMAG(x) H8500BADMAG(x)