xref: /openbsd/gnu/usr.bin/binutils/bfd/cpu-sh.c (revision 007c2a45)
1c074d1c9Sdrahn /* BFD library support routines for the Renesas / SuperH SH architecture.
2c074d1c9Sdrahn    Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003
3c074d1c9Sdrahn    Free Software Foundation, Inc.
42159047fSniklas    Hacked by Steve Chamberlain of Cygnus Support.
52159047fSniklas 
62159047fSniklas    This file is part of BFD, the Binary File Descriptor library.
72159047fSniklas 
82159047fSniklas    This program is free software; you can redistribute it and/or modify
92159047fSniklas    it under the terms of the GNU General Public License as published by
102159047fSniklas    the Free Software Foundation; either version 2 of the License, or
112159047fSniklas    (at your option) any later version.
122159047fSniklas 
132159047fSniklas    This program is distributed in the hope that it will be useful,
142159047fSniklas    but WITHOUT ANY WARRANTY; without even the implied warranty of
152159047fSniklas    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
162159047fSniklas    GNU General Public License for more details.
172159047fSniklas 
182159047fSniklas    You should have received a copy of the GNU General Public License
192159047fSniklas    along with this program; if not, write to the Free Software
202159047fSniklas    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
212159047fSniklas 
222159047fSniklas #include "bfd.h"
232159047fSniklas #include "sysdep.h"
242159047fSniklas #include "libbfd.h"
252159047fSniklas 
26f7cc78ecSespie #define SH_NEXT      &arch_info_struct[0]
27f7cc78ecSespie #define SH2_NEXT     &arch_info_struct[1]
28c074d1c9Sdrahn #define SH2E_NEXT    &arch_info_struct[2]
29c074d1c9Sdrahn #define SH_DSP_NEXT  &arch_info_struct[3]
30c074d1c9Sdrahn #define SH3_NEXT     &arch_info_struct[4]
31c074d1c9Sdrahn #define SH3_DSP_NEXT &arch_info_struct[5]
32c074d1c9Sdrahn #define SH3E_NEXT    &arch_info_struct[6]
33c074d1c9Sdrahn #define SH4_NEXT     &arch_info_struct[7]
34*007c2a45Smiod #define SH4A_NEXT    &arch_info_struct[8]
35*007c2a45Smiod #define SH4AL_DSP_NEXT &arch_info_struct[9]
36*007c2a45Smiod #define SH4_NOFPU_NEXT &arch_info_struct[10]
37*007c2a45Smiod #define SH4A_NOFPU_NEXT &arch_info_struct[11]
38c074d1c9Sdrahn #define SH64_NEXT    NULL
39f7cc78ecSespie 
40f7cc78ecSespie static const bfd_arch_info_type arch_info_struct[] =
41f7cc78ecSespie {
42f7cc78ecSespie   {
43f7cc78ecSespie     32,				/* 32 bits in a word */
44f7cc78ecSespie     32,				/* 32 bits in an address */
45f7cc78ecSespie     8,				/* 8 bits in a byte */
46f7cc78ecSespie     bfd_arch_sh,
47f7cc78ecSespie     bfd_mach_sh2,
48f7cc78ecSespie     "sh",			/* arch_name  */
49f7cc78ecSespie     "sh2",			/* printable name */
50f7cc78ecSespie     1,
51c074d1c9Sdrahn     FALSE,			/* not the default */
52f7cc78ecSespie     bfd_default_compatible,
53c074d1c9Sdrahn     bfd_default_scan,
54f7cc78ecSespie     SH2_NEXT
55f7cc78ecSespie   },
56f7cc78ecSespie   {
57f7cc78ecSespie     32,				/* 32 bits in a word */
58f7cc78ecSespie     32,				/* 32 bits in an address */
59f7cc78ecSespie     8,				/* 8 bits in a byte */
60f7cc78ecSespie     bfd_arch_sh,
61c074d1c9Sdrahn     bfd_mach_sh2e,
62c074d1c9Sdrahn     "sh",			/* arch_name  */
63c074d1c9Sdrahn     "sh2e",			/* printable name */
64c074d1c9Sdrahn     1,
65c074d1c9Sdrahn     FALSE,			/* not the default */
66c074d1c9Sdrahn     bfd_default_compatible,
67c074d1c9Sdrahn     bfd_default_scan,
68c074d1c9Sdrahn     SH2E_NEXT
69c074d1c9Sdrahn   },
70c074d1c9Sdrahn   {
71c074d1c9Sdrahn     32,				/* 32 bits in a word */
72c074d1c9Sdrahn     32,				/* 32 bits in an address */
73c074d1c9Sdrahn     8,				/* 8 bits in a byte */
74c074d1c9Sdrahn     bfd_arch_sh,
75f7cc78ecSespie     bfd_mach_sh_dsp,
76f7cc78ecSespie     "sh",			/* arch_name  */
77f7cc78ecSespie     "sh-dsp",			/* printable name */
78f7cc78ecSespie     1,
79c074d1c9Sdrahn     FALSE,			/* not the default */
80f7cc78ecSespie     bfd_default_compatible,
81c074d1c9Sdrahn     bfd_default_scan,
82f7cc78ecSespie     SH_DSP_NEXT
83f7cc78ecSespie   },
84f7cc78ecSespie   {
85f7cc78ecSespie     32,				/* 32 bits in a word */
86f7cc78ecSespie     32,				/* 32 bits in an address */
87f7cc78ecSespie     8,				/* 8 bits in a byte */
88f7cc78ecSespie     bfd_arch_sh,
89f7cc78ecSespie     bfd_mach_sh3,
90f7cc78ecSespie     "sh",			/* arch_name  */
91f7cc78ecSespie     "sh3",			/* printable name */
92f7cc78ecSespie     1,
93c074d1c9Sdrahn     FALSE,			/* not the default */
94f7cc78ecSespie     bfd_default_compatible,
95c074d1c9Sdrahn     bfd_default_scan,
96f7cc78ecSespie     SH3_NEXT
97f7cc78ecSespie   },
98f7cc78ecSespie   {
99f7cc78ecSespie     32,				/* 32 bits in a word */
100f7cc78ecSespie     32,				/* 32 bits in an address */
101f7cc78ecSespie     8,				/* 8 bits in a byte */
102f7cc78ecSespie     bfd_arch_sh,
103f7cc78ecSespie     bfd_mach_sh3_dsp,
104f7cc78ecSespie     "sh",			/* arch_name  */
105f7cc78ecSespie     "sh3-dsp",			/* printable name */
106f7cc78ecSespie     1,
107c074d1c9Sdrahn     FALSE,			/* not the default */
108f7cc78ecSespie     bfd_default_compatible,
109c074d1c9Sdrahn     bfd_default_scan,
110f7cc78ecSespie     SH3_DSP_NEXT
111f7cc78ecSespie   },
112f7cc78ecSespie   {
113f7cc78ecSespie     32,				/* 32 bits in a word */
114f7cc78ecSespie     32,				/* 32 bits in an address */
115f7cc78ecSespie     8,				/* 8 bits in a byte */
116f7cc78ecSespie     bfd_arch_sh,
117f7cc78ecSespie     bfd_mach_sh3e,
118f7cc78ecSespie     "sh",			/* arch_name  */
119f7cc78ecSespie     "sh3e",			/* printable name */
120f7cc78ecSespie     1,
121c074d1c9Sdrahn     FALSE,			/* not the default */
122f7cc78ecSespie     bfd_default_compatible,
123c074d1c9Sdrahn     bfd_default_scan,
124f7cc78ecSespie     SH3E_NEXT
125f7cc78ecSespie   },
126f7cc78ecSespie   {
127f7cc78ecSespie     32,				/* 32 bits in a word */
128f7cc78ecSespie     32,				/* 32 bits in an address */
129f7cc78ecSespie     8,				/* 8 bits in a byte */
130f7cc78ecSespie     bfd_arch_sh,
131f7cc78ecSespie     bfd_mach_sh4,
132f7cc78ecSespie     "sh",			/* arch_name  */
133f7cc78ecSespie     "sh4",			/* printable name */
134f7cc78ecSespie     1,
135c074d1c9Sdrahn     FALSE,			/* not the default */
136f7cc78ecSespie     bfd_default_compatible,
137c074d1c9Sdrahn     bfd_default_scan,
138f7cc78ecSespie     SH4_NEXT
139f7cc78ecSespie   },
140c074d1c9Sdrahn   {
141*007c2a45Smiod     32,				/* 32 bits in a word */
142*007c2a45Smiod     32,				/* 32 bits in an address */
143*007c2a45Smiod     8,				/* 8 bits in a byte */
144*007c2a45Smiod     bfd_arch_sh,
145*007c2a45Smiod     bfd_mach_sh4a,
146*007c2a45Smiod     "sh",			/* arch_name  */
147*007c2a45Smiod     "sh4a",			/* printable name */
148*007c2a45Smiod     1,
149*007c2a45Smiod     FALSE,			/* not the default */
150*007c2a45Smiod     bfd_default_compatible,
151*007c2a45Smiod     bfd_default_scan,
152*007c2a45Smiod     SH4A_NEXT
153*007c2a45Smiod   },
154*007c2a45Smiod   {
155*007c2a45Smiod     32,				/* 32 bits in a word */
156*007c2a45Smiod     32,				/* 32 bits in an address */
157*007c2a45Smiod     8,				/* 8 bits in a byte */
158*007c2a45Smiod     bfd_arch_sh,
159*007c2a45Smiod     bfd_mach_sh4al_dsp,
160*007c2a45Smiod     "sh",			/* arch_name  */
161*007c2a45Smiod     "sh4al-dsp",		/* printable name */
162*007c2a45Smiod     1,
163*007c2a45Smiod     FALSE,			/* not the default */
164*007c2a45Smiod     bfd_default_compatible,
165*007c2a45Smiod     bfd_default_scan,
166*007c2a45Smiod     SH4AL_DSP_NEXT
167*007c2a45Smiod   },
168*007c2a45Smiod   {
169*007c2a45Smiod     32,				/* 32 bits in a word */
170*007c2a45Smiod     32,				/* 32 bits in an address */
171*007c2a45Smiod     8,				/* 8 bits in a byte */
172*007c2a45Smiod     bfd_arch_sh,
173*007c2a45Smiod     bfd_mach_sh4_nofpu,
174*007c2a45Smiod     "sh",			/* arch_name  */
175*007c2a45Smiod     "sh4-nofpu",		/* printable name */
176*007c2a45Smiod     1,
177*007c2a45Smiod     FALSE,			/* not the default */
178*007c2a45Smiod     bfd_default_compatible,
179*007c2a45Smiod     bfd_default_scan,
180*007c2a45Smiod     SH4_NOFPU_NEXT
181*007c2a45Smiod   },
182*007c2a45Smiod   {
183*007c2a45Smiod     32,				/* 32 bits in a word */
184*007c2a45Smiod     32,				/* 32 bits in an address */
185*007c2a45Smiod     8,				/* 8 bits in a byte */
186*007c2a45Smiod     bfd_arch_sh,
187*007c2a45Smiod     bfd_mach_sh4a_nofpu,
188*007c2a45Smiod     "sh",			/* arch_name  */
189*007c2a45Smiod     "sh4a-nofpu",		/* printable name */
190*007c2a45Smiod     1,
191*007c2a45Smiod     FALSE,			/* not the default */
192*007c2a45Smiod     bfd_default_compatible,
193*007c2a45Smiod     bfd_default_scan,
194*007c2a45Smiod     SH4A_NOFPU_NEXT
195*007c2a45Smiod   },
196*007c2a45Smiod   {
197c074d1c9Sdrahn     64,				/* 64 bits in a word */
198c074d1c9Sdrahn     64,				/* 64 bits in an address */
199c074d1c9Sdrahn     8,				/* 8 bits in a byte */
200c074d1c9Sdrahn     bfd_arch_sh,
201c074d1c9Sdrahn     bfd_mach_sh5,
202c074d1c9Sdrahn     "sh",			/* arch_name  */
203c074d1c9Sdrahn     "sh5",			/* printable name */
204c074d1c9Sdrahn     1,
205c074d1c9Sdrahn     FALSE,			/* not the default */
206c074d1c9Sdrahn     bfd_default_compatible,
207c074d1c9Sdrahn     bfd_default_scan,
208c074d1c9Sdrahn     SH64_NEXT
209c074d1c9Sdrahn   },
210f7cc78ecSespie };
211f7cc78ecSespie 
2122159047fSniklas const bfd_arch_info_type bfd_sh_arch =
2132159047fSniklas {
2142159047fSniklas   32,				/* 32 bits in a word */
2152159047fSniklas   32,				/* 32 bits in an address */
2162159047fSniklas   8,				/* 8 bits in a byte */
2172159047fSniklas   bfd_arch_sh,
218f7cc78ecSespie   bfd_mach_sh,
2192159047fSniklas   "sh",				/* arch_name  */
2202159047fSniklas   "sh",				/* printable name */
2212159047fSniklas   1,
222c074d1c9Sdrahn   TRUE,				/* the default machine */
2232159047fSniklas   bfd_default_compatible,
224c074d1c9Sdrahn   bfd_default_scan,
225f7cc78ecSespie   SH_NEXT
2262159047fSniklas };
227