diff options
author | Nick Clifton <nickc@redhat.com> | 2004-01-12 15:02:22 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2004-01-12 15:02:22 +0000 |
commit | ca9a79a174a35d35d26724cdc223facb1c913700 (patch) | |
tree | f0bd8bc540334a79b842cb3a60a70a5fcec58c0b /bfd/coff-h8300.c | |
parent | a94154757c96c5e4fbba4b2846befbc70b7d10b7 (diff) | |
download | gdb-ca9a79a174a35d35d26724cdc223facb1c913700.zip gdb-ca9a79a174a35d35d26724cdc223facb1c913700.tar.gz gdb-ca9a79a174a35d35d26724cdc223facb1c913700.tar.bz2 |
Add support for relaxation of bit manipulation instructions.
Diffstat (limited to 'bfd/coff-h8300.c')
-rw-r--r-- | bfd/coff-h8300.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index e9d1964..dc35ea9 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 (); } |