]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/cpu-sh.c
bfd:
[thirdparty/binutils-gdb.git] / bfd / cpu-sh.c
CommitLineData
ef230218 1/* BFD library support routines for the Renesas / SuperH SH architecture.
5177500f 2 Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002, 2003
dc810e39 3 Free Software Foundation, Inc.
252b5132
RH
4 Hacked by Steve Chamberlain of Cygnus Support.
5
5177500f 6 This file is part of BFD, the Binary File Descriptor library.
252b5132 7
5177500f
NC
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.
252b5132 12
5177500f
NC
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.
252b5132 17
5177500f
NC
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. */
252b5132
RH
21
22#include "bfd.h"
23#include "sysdep.h"
24#include "libbfd.h"
25
252b5132
RH
26#if 0
27/* This routine is provided two arch_infos and returns whether
5177500f 28 they'd be compatible. */
252b5132
RH
29
30static const bfd_arch_info_type *
31compatible (a,b)
32 const bfd_arch_info_type *a;
33 const bfd_arch_info_type *b;
34{
35 if (a->arch != b->arch || a->mach != b->mach)
5177500f 36 return NULL;
252b5132
RH
37 return a;
38}
39#endif
40
38b1a46c
NC
41#define SH_NEXT &arch_info_struct[0]
42#define SH2_NEXT &arch_info_struct[1]
5177500f
NC
43#define SH2E_NEXT &arch_info_struct[2]
44#define SH_DSP_NEXT &arch_info_struct[3]
45#define SH3_NEXT &arch_info_struct[4]
46#define SH3_DSP_NEXT &arch_info_struct[5]
47#define SH3E_NEXT &arch_info_struct[6]
48#define SH4_NEXT &arch_info_struct[7]
fbca6ad9 49#define SH64_NEXT NULL
252b5132 50
71f6b586 51static const bfd_arch_info_type arch_info_struct[] =
252b5132 52{
d4845d57
JR
53 {
54 32, /* 32 bits in a word */
55 32, /* 32 bits in an address */
56 8, /* 8 bits in a byte */
57 bfd_arch_sh,
58 bfd_mach_sh2,
59 "sh", /* arch_name */
60 "sh2", /* printable name */
61 1,
b34976b6 62 FALSE, /* not the default */
d4845d57 63 bfd_default_compatible,
a44d7f9c 64 bfd_default_scan,
d4845d57
JR
65 SH2_NEXT
66 },
5177500f
NC
67 {
68 32, /* 32 bits in a word */
69 32, /* 32 bits in an address */
70 8, /* 8 bits in a byte */
71 bfd_arch_sh,
72 bfd_mach_sh2e,
73 "sh", /* arch_name */
74 "sh2e", /* printable name */
75 1,
76 FALSE, /* not the default */
77 bfd_default_compatible,
78 bfd_default_scan,
79 SH2E_NEXT
80 },
d4845d57
JR
81 {
82 32, /* 32 bits in a word */
83 32, /* 32 bits in an address */
84 8, /* 8 bits in a byte */
85 bfd_arch_sh,
86 bfd_mach_sh_dsp,
87 "sh", /* arch_name */
88 "sh-dsp", /* printable name */
89 1,
b34976b6 90 FALSE, /* not the default */
d4845d57 91 bfd_default_compatible,
a44d7f9c 92 bfd_default_scan,
d4845d57
JR
93 SH_DSP_NEXT
94 },
252b5132
RH
95 {
96 32, /* 32 bits in a word */
97 32, /* 32 bits in an address */
98 8, /* 8 bits in a byte */
99 bfd_arch_sh,
100 bfd_mach_sh3,
101 "sh", /* arch_name */
102 "sh3", /* printable name */
103 1,
b34976b6 104 FALSE, /* not the default */
252b5132 105 bfd_default_compatible,
a44d7f9c 106 bfd_default_scan,
252b5132
RH
107 SH3_NEXT
108 },
d4845d57
JR
109 {
110 32, /* 32 bits in a word */
111 32, /* 32 bits in an address */
112 8, /* 8 bits in a byte */
113 bfd_arch_sh,
114 bfd_mach_sh3_dsp,
115 "sh", /* arch_name */
116 "sh3-dsp", /* printable name */
117 1,
b34976b6 118 FALSE, /* not the default */
d4845d57 119 bfd_default_compatible,
a44d7f9c 120 bfd_default_scan,
d4845d57
JR
121 SH3_DSP_NEXT
122 },
252b5132
RH
123 {
124 32, /* 32 bits in a word */
125 32, /* 32 bits in an address */
126 8, /* 8 bits in a byte */
127 bfd_arch_sh,
128 bfd_mach_sh3e,
129 "sh", /* arch_name */
130 "sh3e", /* printable name */
131 1,
b34976b6 132 FALSE, /* not the default */
252b5132 133 bfd_default_compatible,
a44d7f9c 134 bfd_default_scan,
252b5132
RH
135 SH3E_NEXT
136 },
d4845d57
JR
137 {
138 32, /* 32 bits in a word */
139 32, /* 32 bits in an address */
140 8, /* 8 bits in a byte */
141 bfd_arch_sh,
142 bfd_mach_sh4,
143 "sh", /* arch_name */
144 "sh4", /* printable name */
145 1,
b34976b6 146 FALSE, /* not the default */
d4845d57 147 bfd_default_compatible,
a44d7f9c 148 bfd_default_scan,
d4845d57
JR
149 SH4_NEXT
150 },
fbca6ad9
AO
151 {
152 64, /* 64 bits in a word */
153 64, /* 64 bits in an address */
154 8, /* 8 bits in a byte */
155 bfd_arch_sh,
156 bfd_mach_sh5,
157 "sh", /* arch_name */
158 "sh5", /* printable name */
159 1,
b34976b6 160 FALSE, /* not the default */
fbca6ad9 161 bfd_default_compatible,
a44d7f9c 162 bfd_default_scan,
fbca6ad9
AO
163 SH64_NEXT
164 },
252b5132
RH
165};
166
167const bfd_arch_info_type bfd_sh_arch =
168{
169 32, /* 32 bits in a word */
170 32, /* 32 bits in an address */
171 8, /* 8 bits in a byte */
172 bfd_arch_sh,
173 bfd_mach_sh,
174 "sh", /* arch_name */
175 "sh", /* printable name */
176 1,
b34976b6 177 TRUE, /* the default machine */
252b5132 178 bfd_default_compatible,
a44d7f9c 179 bfd_default_scan,
252b5132
RH
180 SH_NEXT
181};