1 /* BFD library support routines for the Hitachi H8/300 architecture.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000
3 Free Software Foundation, Inc.
4 Hacked by Steve Chamberlain of Cygnus Support.
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 int bfd_default_scan_num_mach ();
29 h8300_scan (info, string)
30 const struct bfd_arch_info *info;
33 if (*string != 'h' && *string != 'H')
55 if (*string == 'h' || *string == 'H')
57 return (info->mach == bfd_mach_h8300h);
59 else if (*string == 's' || *string == 'S')
61 return (info->mach == bfd_mach_h8300s);
65 return info->mach == bfd_mach_h8300;
69 /* This routine is provided two arch_infos and works out the machine
70 which would be compatible with both and returns a pointer to its
73 static const bfd_arch_info_type *
75 const bfd_arch_info_type *in;
76 const bfd_arch_info_type *out;
78 /* It's really not a good idea to mix and match modes. */
79 if (in->mach != out->mach)
85 static const bfd_arch_info_type h8300_info_struct =
87 16, /* 16 bits in a word */
88 16, /* 16 bits in an address */
89 8, /* 8 bits in a byte */
92 "h8300", /* arch_name */
93 "h8300", /* printable name */
95 true, /* the default machine */
99 local_bfd_reloc_type_lookup,
104 static const bfd_arch_info_type h8300h_info_struct =
106 32, /* 32 bits in a word */
107 32, /* 32 bits in an address */
108 8, /* 8 bits in a byte */
111 "h8300h", /* arch_name */
112 "h8300h", /* printable name */
114 false, /* the default machine */
118 local_bfd_reloc_type_lookup,
123 const bfd_arch_info_type bfd_h8300_arch =
125 32, /* 32 bits in a word */
126 32, /* 32 bits in an address */
127 8, /* 8 bits in a byte */
130 "h8300s", /* arch_name */
131 "h8300s", /* printable name */
133 false, /* the default machine */
137 local_bfd_reloc_type_lookup,