summaryrefslogtreecommitdiff
path: root/bfd/coff-h8300.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-01-12 15:02:22 +0000
committerNick Clifton <nickc@redhat.com>2004-01-12 15:02:22 +0000
commit03b84766fe6fc1bcb259f92de00fc066d9e17162 (patch)
tree9333715f1c1bd7fed36d6f4da30028c9dc7ecda5 /bfd/coff-h8300.c
parent71db9100a861031b7e364362dd9a5b5036348e68 (diff)
downloadbinutils-redhat-03b84766fe6fc1bcb259f92de00fc066d9e17162.tar.gz
Add support for relaxation of bit manipulation instructions.
Diffstat (limited to 'bfd/coff-h8300.c')
-rw-r--r--bfd/coff-h8300.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index e9d19643e4..dc35ea98d7 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -1,6 +1,6 @@
/* BFD back-end for Renesas H8/300 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>.
@@ -666,6 +666,7 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
bfd_vma value;
bfd_vma dot;
int gap, tmp;
+ unsigned char temp_code;
switch (reloc->howto->type)
{
@@ -947,8 +948,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
if (data[dst_address - 2] != 0x6a)
abort ();
+ temp_code = data[src_address - 1];
+ if ((temp_code & 0x10) != 0x10)
+ temp_code &= 0xf0;
+
/* Fix up the opcode. */
- switch (data[src_address - 1] & 0xf0)
+ switch (temp_code)
{
case 0x00:
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20;
@@ -956,6 +961,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
case 0x80:
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30;
break;
+ case 0x18:
+ data[dst_address - 2] = 0x7f;
+ break;
+ case 0x10:
+ data[dst_address - 2] = 0x7e;
+ break;
default:
abort ();
}
@@ -972,8 +983,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
if (data[dst_address - 2] != 0x6a)
abort ();
+ temp_code = data[src_address - 1];
+ if ((temp_code & 0x30) != 0x30)
+ temp_code &= 0xf0;
+
/* Fix up the opcode. */
- switch (data[src_address - 1] & 0xf0)
+ switch (temp_code)
{
case 0x20:
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20;
@@ -981,6 +996,12 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
case 0xa0:
data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30;
break;
+ case 0x38:
+ data[dst_address - 2] = 0x7f;
+ break;
+ case 0x30:
+ data[dst_address - 2] = 0x7e;
+ break;
default:
abort ();
}