/* BFD library support routines for the Hitachi H8/300 architecture.
- Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000, 2001
+ Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#include "sysdep.h"
#include "libbfd.h"
-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)
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++;
+ return h8300_scan (info, string);
+ }
+
if (*string == 'h' || *string == 'H')
{
return (info->mach == bfd_mach_h8300h);
}
}
-
-/* This routine is provided two arch_infos and works out the
- machine which would be compatible with both and returns a pointer
- to its info structure */
+/* This routine is provided two arch_infos and works out the machine
+ which would be compatible with both and returns a pointer to its
+ info structure. */
static const bfd_arch_info_type *
compatible (in, out)
- const bfd_arch_info_type * in;
- const bfd_arch_info_type * out;
+ const bfd_arch_info_type *in;
+ const bfd_arch_info_type *out;
{
/* It's really not a good idea to mix and match modes. */
if (in->mach != out->mach)
true, /* the default machine */
compatible,
h8300_scan,
-/* local_bfd_reloc_type_lookup, */
+#if 0
+ local_bfd_reloc_type_lookup,
+#endif
0,
};
false, /* the default machine */
compatible,
h8300_scan,
-/* local_bfd_reloc_type_lookup, */
+#if 0
+ local_bfd_reloc_type_lookup,
+#endif
&h8300_info_struct,
};
false, /* the default machine */
compatible,
h8300_scan,
-/* local_bfd_reloc_type_lookup, */
+#if 0
+ local_bfd_reloc_type_lookup,
+#endif
&h8300h_info_struct,
};