aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-h8300.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1994-03-24 19:45:23 +0000
committerSteve Chamberlain <sac@cygnus>1994-03-24 19:45:23 +0000
commit47e70c54174be52f55eb38fe8630af68ef9c2b42 (patch)
tree8224c7d68e7855a15919abfa820f1eb68408118c /bfd/coff-h8300.c
parent2f3b7d8eb5f3f7823556b77cdd48ff2ae51b09c4 (diff)
downloadgdb-47e70c54174be52f55eb38fe8630af68ef9c2b42.zip
gdb-47e70c54174be52f55eb38fe8630af68ef9c2b42.tar.gz
gdb-47e70c54174be52f55eb38fe8630af68ef9c2b42.tar.bz2
Thu Mar 24 11:33:46 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info for 16bit relative branches. * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on overflow.
Diffstat (limited to 'bfd/coff-h8300.c')
-rw-r--r--bfd/coff-h8300.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index 75b7a81..54aa028 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -1,5 +1,5 @@
/* 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.
@@ -53,7 +53,7 @@ static reloc_howto_type howto_table[] =
/* 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 */
@@ -148,12 +148,12 @@ rtype2howto (internal, dst)
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);
@@ -177,9 +177,9 @@ DEFUN (reloc_processing, (relent, reloc, symbols, abfd, section),
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;
@@ -218,7 +218,7 @@ h8300_reloc16_estimate(input_section, symbols, reloc, shrink, 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;
@@ -246,7 +246,7 @@ h8300_reloc16_estimate(input_section, symbols, reloc, shrink, link_info)
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;
@@ -274,7 +274,7 @@ h8300_reloc16_estimate(input_section, symbols, reloc, shrink, link_info)
/* 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;
}
@@ -336,6 +336,28 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
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;
+ }
case R_RELBYTE:
{