daily update
[binutils.git] / bfd / cpu-sh.c
blob3331c27cc388f119b6dd9ea13b986ce1b7ddc669
1 /* BFD library support routines for the Hitachi-SH architecture.
2 Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002
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. */
22 #include "bfd.h"
23 #include "sysdep.h"
24 #include "libbfd.h"
26 #if 0
27 /* This routine is provided two arch_infos and returns whether
28 they'd be compatible */
30 static const bfd_arch_info_type *
31 compatible (a,b)
32 const bfd_arch_info_type *a;
33 const bfd_arch_info_type *b;
35 if (a->arch != b->arch || a->mach != b->mach)
36 return NULL;
37 return a;
39 #endif
41 #define SH_NEXT &arch_info_struct[0]
42 #define SH2_NEXT &arch_info_struct[1]
43 #define SH_DSP_NEXT &arch_info_struct[2]
44 #define SH3_NEXT &arch_info_struct[3]
45 #define SH3_DSP_NEXT &arch_info_struct[4]
46 #define SH3E_NEXT &arch_info_struct[5]
47 #define SH4_NEXT NULL
48 #undef SH4_NEXT
49 #define SH4_NEXT &arch_info_struct[6]
50 #define SH64_NEXT NULL
52 static const bfd_arch_info_type arch_info_struct[] =
55 32, /* 32 bits in a word */
56 32, /* 32 bits in an address */
57 8, /* 8 bits in a byte */
58 bfd_arch_sh,
59 bfd_mach_sh2,
60 "sh", /* arch_name */
61 "sh2", /* printable name */
63 FALSE, /* not the default */
64 bfd_default_compatible,
65 bfd_default_scan,
66 SH2_NEXT
69 32, /* 32 bits in a word */
70 32, /* 32 bits in an address */
71 8, /* 8 bits in a byte */
72 bfd_arch_sh,
73 bfd_mach_sh_dsp,
74 "sh", /* arch_name */
75 "sh-dsp", /* printable name */
77 FALSE, /* not the default */
78 bfd_default_compatible,
79 bfd_default_scan,
80 SH_DSP_NEXT
83 32, /* 32 bits in a word */
84 32, /* 32 bits in an address */
85 8, /* 8 bits in a byte */
86 bfd_arch_sh,
87 bfd_mach_sh3,
88 "sh", /* arch_name */
89 "sh3", /* printable name */
91 FALSE, /* not the default */
92 bfd_default_compatible,
93 bfd_default_scan,
94 SH3_NEXT
97 32, /* 32 bits in a word */
98 32, /* 32 bits in an address */
99 8, /* 8 bits in a byte */
100 bfd_arch_sh,
101 bfd_mach_sh3_dsp,
102 "sh", /* arch_name */
103 "sh3-dsp", /* printable name */
105 FALSE, /* not the default */
106 bfd_default_compatible,
107 bfd_default_scan,
108 SH3_DSP_NEXT
111 32, /* 32 bits in a word */
112 32, /* 32 bits in an address */
113 8, /* 8 bits in a byte */
114 bfd_arch_sh,
115 bfd_mach_sh3e,
116 "sh", /* arch_name */
117 "sh3e", /* printable name */
119 FALSE, /* not the default */
120 bfd_default_compatible,
121 bfd_default_scan,
122 SH3E_NEXT
125 32, /* 32 bits in a word */
126 32, /* 32 bits in an address */
127 8, /* 8 bits in a byte */
128 bfd_arch_sh,
129 bfd_mach_sh4,
130 "sh", /* arch_name */
131 "sh4", /* printable name */
133 FALSE, /* not the default */
134 bfd_default_compatible,
135 bfd_default_scan,
136 SH4_NEXT
139 64, /* 64 bits in a word */
140 64, /* 64 bits in an address */
141 8, /* 8 bits in a byte */
142 bfd_arch_sh,
143 bfd_mach_sh5,
144 "sh", /* arch_name */
145 "sh5", /* printable name */
147 FALSE, /* not the default */
148 bfd_default_compatible,
149 bfd_default_scan,
150 SH64_NEXT
154 const bfd_arch_info_type bfd_sh_arch =
156 32, /* 32 bits in a word */
157 32, /* 32 bits in an address */
158 8, /* 8 bits in a byte */
159 bfd_arch_sh,
160 bfd_mach_sh,
161 "sh", /* arch_name */
162 "sh", /* printable name */
164 TRUE, /* the default machine */
165 bfd_default_compatible,
166 bfd_default_scan,
167 SH_NEXT