1 /* BFD library support routines for the Hitachi-SH architecture.
2 Copyright 1993, 1994, 1997, 1998, 2000, 2001
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 static boolean scan_mach
27 PARAMS ((const struct bfd_arch_info *, const char *));
30 scan_mach (info, string)
31 const struct bfd_arch_info *info;
34 if (strcasecmp (info->printable_name, string) == 0)
40 /* This routine is provided two arch_infos and returns whether
41 they'd be compatible */
43 static const bfd_arch_info_type *
45 const bfd_arch_info_type *a;
46 const bfd_arch_info_type *b;
48 if (a->arch != b->arch || a->mach != b->mach)
54 #define SH_NEXT &arch_info_struct[0]
55 #define SH2_NEXT &arch_info_struct[1]
56 #define SH_DSP_NEXT &arch_info_struct[2]
57 #define SH3_NEXT &arch_info_struct[3]
58 #define SH3_DSP_NEXT &arch_info_struct[4]
59 #define SH3E_NEXT &arch_info_struct[5]
62 static const bfd_arch_info_type arch_info_struct[] =
65 32, /* 32 bits in a word */
66 32, /* 32 bits in an address */
67 8, /* 8 bits in a byte */
71 "sh2", /* printable name */
73 false, /* not the default */
74 bfd_default_compatible,
79 32, /* 32 bits in a word */
80 32, /* 32 bits in an address */
81 8, /* 8 bits in a byte */
85 "sh-dsp", /* printable name */
87 false, /* not the default */
88 bfd_default_compatible,
93 32, /* 32 bits in a word */
94 32, /* 32 bits in an address */
95 8, /* 8 bits in a byte */
99 "sh3", /* printable name */
101 false, /* not the default */
102 bfd_default_compatible,
107 32, /* 32 bits in a word */
108 32, /* 32 bits in an address */
109 8, /* 8 bits in a byte */
112 "sh", /* arch_name */
113 "sh3-dsp", /* printable name */
115 false, /* not the default */
116 bfd_default_compatible,
121 32, /* 32 bits in a word */
122 32, /* 32 bits in an address */
123 8, /* 8 bits in a byte */
126 "sh", /* arch_name */
127 "sh3e", /* printable name */
129 false, /* not the default */
130 bfd_default_compatible,
135 32, /* 32 bits in a word */
136 32, /* 32 bits in an address */
137 8, /* 8 bits in a byte */
140 "sh", /* arch_name */
141 "sh4", /* printable name */
143 false, /* not the default */
144 bfd_default_compatible,
150 const bfd_arch_info_type bfd_sh_arch =
152 32, /* 32 bits in a word */
153 32, /* 32 bits in an address */
154 8, /* 8 bits in a byte */
157 "sh", /* arch_name */
158 "sh", /* printable name */
160 true, /* the default machine */
161 bfd_default_compatible,