summaryrefslogtreecommitdiff
path: root/bfd/cpu-h8300.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2001-08-29 17:23:16 +0000
committerJeff Law <law@redhat.com>2001-08-29 17:23:16 +0000
commite33faea9176124fbaf7211ce6a912466a3da345b (patch)
tree3a45eb74e05cd9b9559646b2f34e9d4968474ee0 /bfd/cpu-h8300.c
parentbed57a99ddc4d08c2c7a95cee47f1e37bace77a9 (diff)
downloadbinutils-redhat-e33faea9176124fbaf7211ce6a912466a3da345b.tar.gz
* cpu-h8300.c (h8300_scan, compatible): Prototype.
(h8300_scan): Handle architecture:machine encodings typically found in linker scripts. * elf.c (prep_headers): Do not try to do H8 machine recognition here. * elf32-h8300.c: Add some missing prototypes. (elf32_h8_mach, elf32_h8_final_write_processing): New functions. (elf32_h8_object_p): Similarly.
Diffstat (limited to 'bfd/cpu-h8300.c')
-rw-r--r--bfd/cpu-h8300.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index b25842ed33..4e36952d95 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -1,5 +1,5 @@
/* BFD library support routines for the Hitachi H8/300 architecture.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000, 2001
Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
@@ -25,6 +25,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
int bfd_default_scan_num_mach ();
+static boolean h8300_scan
+ PARAMS ((const struct bfd_arch_info *, const char *));
+static const bfd_arch_info_type * compatible
+ PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+
static boolean
h8300_scan (info, string)
const struct bfd_arch_info *info;
@@ -52,6 +57,18 @@ h8300_scan (info, string)
string++;
if (*string == '-')
string++;
+
+ /* In ELF linker scripts, we typically express the architecture/machine
+ as architecture:machine.
+
+ So if we've matched so far and encounter a colon, try to match the
+ string following the colon. */
+ if (*string == ':')
+ {
+ string++;
+ h8300_scan (info, string);
+ }
+
if (*string == 'h' || *string == 'H')
{
return (info->mach == bfd_mach_h8300h);