2009-07-07 Tristan Gingold <gingold@adacore.com>
[deliverable/binutils-gdb.git] / bfd / cpu-powerpc.c
CommitLineData
252b5132 1/* BFD PowerPC CPU definition
9239aded 2 Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2007, 2008
899f54f5 3 Free Software Foundation, Inc.
252b5132
RH
4 Contributed by Ian Lance Taylor, Cygnus Support.
5
cd123cb7
NC
6 This file is part of BFD, the Binary File Descriptor library.
7
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 3 of the License, or
11 (at your option) any later version.
12
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.
17
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., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
252b5132 22
252b5132 23#include "sysdep.h"
3db64b00 24#include "bfd.h"
252b5132
RH
25#include "libbfd.h"
26
27/* The common PowerPC architecture is compatible with the RS/6000. */
28
29static const bfd_arch_info_type *powerpc_compatible
30 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
31
32static const bfd_arch_info_type *
33powerpc_compatible (a,b)
34 const bfd_arch_info_type *a;
35 const bfd_arch_info_type *b;
36{
37 BFD_ASSERT (a->arch == bfd_arch_powerpc);
38 switch (b->arch)
39 {
40 default:
41 return NULL;
42 case bfd_arch_powerpc:
43 return bfd_default_compatible (a, b);
44 case bfd_arch_rs6000:
43dd9340 45 if (b->mach == bfd_mach_rs6k)
252b5132
RH
46 return a;
47 return NULL;
48 }
49 /*NOTREACHED*/
50}
51
899f54f5 52const bfd_arch_info_type bfd_powerpc_archs[] =
252b5132 53{
feee612b
AM
54#if BFD_DEFAULT_TARGET_SIZE == 64
55 /* Default arch must come first. */
99dc0092
AM
56 {
57 64, /* 64 bits in a word */
58 64, /* 64 bits in an address */
59 8, /* 8 bits in a byte */
60 bfd_arch_powerpc,
61 bfd_mach_ppc64,
62 "powerpc",
63 "powerpc:common64",
64 3,
b34976b6 65 TRUE, /* default for 64 bit target */
99dc0092
AM
66 powerpc_compatible,
67 bfd_default_scan,
68 &bfd_powerpc_archs[1]
69 },
feee612b
AM
70 /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
71 being immediately after the 64 bit default. */
99dc0092
AM
72 {
73 32, /* 32 bits in a word */
74 32, /* 32 bits in an address */
75 8, /* 8 bits in a byte */
76 bfd_arch_powerpc,
77 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
78 "powerpc",
79 "powerpc:common",
80 3,
b34976b6 81 FALSE,
99dc0092
AM
82 powerpc_compatible,
83 bfd_default_scan,
84 &bfd_powerpc_archs[2],
85 },
86#else
feee612b 87 /* Default arch must come first. */
99dc0092
AM
88 {
89 32, /* 32 bits in a word */
90 32, /* 32 bits in an address */
91 8, /* 8 bits in a byte */
92 bfd_arch_powerpc,
93 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
94 "powerpc",
95 "powerpc:common",
96 3,
b34976b6 97 TRUE, /* default for 32 bit target */
99dc0092
AM
98 powerpc_compatible,
99 bfd_default_scan,
100 &bfd_powerpc_archs[1],
101 },
feee612b
AM
102 /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
103 being immediately after the 32 bit default. */
99dc0092
AM
104 {
105 64, /* 64 bits in a word */
106 64, /* 64 bits in an address */
107 8, /* 8 bits in a byte */
108 bfd_arch_powerpc,
109 bfd_mach_ppc64,
110 "powerpc",
111 "powerpc:common64",
112 3,
b34976b6 113 FALSE,
99dc0092
AM
114 powerpc_compatible,
115 bfd_default_scan,
116 &bfd_powerpc_archs[2]
117 },
118#endif
252b5132
RH
119 {
120 32, /* 32 bits in a word */
121 32, /* 32 bits in an address */
122 8, /* 8 bits in a byte */
123 bfd_arch_powerpc,
87f33987 124 bfd_mach_ppc_603,
252b5132
RH
125 "powerpc",
126 "powerpc:603",
127 3,
b34976b6 128 FALSE, /* not the default */
71f6b586 129 powerpc_compatible,
252b5132 130 bfd_default_scan,
99dc0092 131 &bfd_powerpc_archs[3]
252b5132
RH
132 },
133 {
134 32, /* 32 bits in a word */
135 32, /* 32 bits in an address */
136 8, /* 8 bits in a byte */
137 bfd_arch_powerpc,
87f33987 138 bfd_mach_ppc_ec603e,
252b5132 139 "powerpc",
87f33987 140 "powerpc:EC603e",
252b5132 141 3,
b34976b6 142 FALSE, /* not the default */
71f6b586 143 powerpc_compatible,
252b5132 144 bfd_default_scan,
99dc0092 145 &bfd_powerpc_archs[4]
252b5132
RH
146 },
147 {
148 32, /* 32 bits in a word */
149 32, /* 32 bits in an address */
150 8, /* 8 bits in a byte */
151 bfd_arch_powerpc,
87f33987 152 bfd_mach_ppc_604,
252b5132 153 "powerpc",
87f33987 154 "powerpc:604",
252b5132 155 3,
b34976b6 156 FALSE, /* not the default */
71f6b586 157 powerpc_compatible,
252b5132 158 bfd_default_scan,
99dc0092 159 &bfd_powerpc_archs[5]
252b5132
RH
160 },
161 {
162 32, /* 32 bits in a word */
163 32, /* 32 bits in an address */
164 8, /* 8 bits in a byte */
165 bfd_arch_powerpc,
87f33987 166 bfd_mach_ppc_403,
252b5132 167 "powerpc",
87f33987 168 "powerpc:403",
252b5132 169 3,
b34976b6 170 FALSE, /* not the default */
71f6b586 171 powerpc_compatible,
252b5132 172 bfd_default_scan,
99dc0092 173 &bfd_powerpc_archs[6]
7f6d05e8 174 },
87f33987 175 {
7f6d05e8 176 32, /* 32 bits in a word */
87f33987
ND
177 32, /* 32 bits in an address */
178 8, /* 8 bits in a byte */
179 bfd_arch_powerpc,
180 bfd_mach_ppc_601,
181 "powerpc",
182 "powerpc:601",
183 3,
b34976b6 184 FALSE, /* not the default */
71f6b586 185 powerpc_compatible,
87f33987 186 bfd_default_scan,
99dc0092 187 &bfd_powerpc_archs[7]
87f33987 188 },
71f6b586 189 {
87f33987 190 64, /* 64 bits in a word */
7f6d05e8
CP
191 64, /* 64 bits in an address */
192 8, /* 8 bits in a byte */
193 bfd_arch_powerpc,
87f33987 194 bfd_mach_ppc_620,
7f6d05e8
CP
195 "powerpc",
196 "powerpc:620",
197 3,
b34976b6 198 FALSE, /* not the default */
71f6b586 199 powerpc_compatible,
7f6d05e8 200 bfd_default_scan,
99dc0092 201 &bfd_powerpc_archs[8]
87f33987
ND
202 },
203 {
204 64, /* 64 bits in a word */
205 64, /* 64 bits in an address */
206 8, /* 8 bits in a byte */
207 bfd_arch_powerpc,
208 bfd_mach_ppc_630,
209 "powerpc",
210 "powerpc:630",
211 3,
b34976b6 212 FALSE, /* not the default */
87f33987
ND
213 powerpc_compatible,
214 bfd_default_scan,
99dc0092 215 &bfd_powerpc_archs[9]
87f33987
ND
216 },
217 {
218 64, /* 64 bits in a word */
219 64, /* 64 bits in an address */
220 8, /* 8 bits in a byte */
221 bfd_arch_powerpc,
222 bfd_mach_ppc_a35,
223 "powerpc",
224 "powerpc:a35",
225 3,
b34976b6 226 FALSE, /* not the default */
87f33987
ND
227 powerpc_compatible,
228 bfd_default_scan,
99dc0092 229 &bfd_powerpc_archs[10]
87f33987
ND
230 },
231 {
232 64, /* 64 bits in a word */
233 64, /* 64 bits in an address */
234 8, /* 8 bits in a byte */
235 bfd_arch_powerpc,
236 bfd_mach_ppc_rs64ii,
237 "powerpc",
238 "powerpc:rs64ii",
239 3,
b34976b6 240 FALSE, /* not the default */
87f33987
ND
241 powerpc_compatible,
242 bfd_default_scan,
99dc0092 243 &bfd_powerpc_archs[11]
87f33987
ND
244 },
245 {
246 64, /* 64 bits in a word */
247 64, /* 64 bits in an address */
248 8, /* 8 bits in a byte */
249 bfd_arch_powerpc,
250 bfd_mach_ppc_rs64iii,
251 "powerpc",
252 "powerpc:rs64iii",
253 3,
b34976b6 254 FALSE, /* not the default */
87f33987
ND
255 powerpc_compatible,
256 bfd_default_scan,
99dc0092 257 &bfd_powerpc_archs[12]
87f33987
ND
258 },
259 {
260 32, /* 32 bits in a word */
261 32, /* 32 bits in an address */
262 8, /* 8 bits in a byte */
263 bfd_arch_powerpc,
264 bfd_mach_ppc_7400,
265 "powerpc",
266 "powerpc:7400",
267 3,
b34976b6 268 FALSE, /* not the default */
87f33987
ND
269 powerpc_compatible,
270 bfd_default_scan,
99dc0092 271 &bfd_powerpc_archs[13]
188ac662 272 },
d62b1198
EZ
273 {
274 32, /* 32 bits in a word */
275 32, /* 32 bits in an address */
276 8, /* 8 bits in a byte */
277 bfd_arch_powerpc,
278 bfd_mach_ppc_e500,
279 "powerpc",
280 "powerpc:e500",
281 3,
b34976b6 282 FALSE,
d62b1198
EZ
283 powerpc_compatible,
284 bfd_default_scan,
285 &bfd_powerpc_archs[14]
286 },
9239aded
AM
287 {
288 32, /* 32 bits in a word */
289 32, /* 32 bits in an address */
290 8, /* 8 bits in a byte */
291 bfd_arch_powerpc,
292 bfd_mach_ppc_e500mc,
293 "powerpc",
294 "powerpc:e500mc",
295 3,
296 FALSE, /* not the default */
297 powerpc_compatible,
298 bfd_default_scan,
299 &bfd_powerpc_archs[15]
300 },
188ac662
GK
301 {
302 32, /* 32 bits in a word */
303 32, /* 32 bits in an address */
304 8, /* 8 bits in a byte */
305 bfd_arch_powerpc,
306 bfd_mach_ppc_860,
307 "powerpc",
308 "powerpc:MPC8XX",
309 3,
b34976b6 310 FALSE, /* not the default */
188ac662
GK
311 powerpc_compatible,
312 bfd_default_scan,
9239aded 313 &bfd_powerpc_archs[16]
1ca81d72
AM
314 },
315 {
316 32, /* 32 bits in a word */
317 32, /* 32 bits in an address */
318 8, /* 8 bits in a byte */
319 bfd_arch_powerpc,
320 bfd_mach_ppc_750,
321 "powerpc",
322 "powerpc:750",
323 3,
324 FALSE, /* not the default */
325 powerpc_compatible,
326 bfd_default_scan,
899f54f5
AM
327 0
328 }
329};
This page took 0.459656 seconds and 4 git commands to generate.