]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD PowerPC CPU definition |
899f54f5 AM |
2 | Copyright 1994, 1995, 1996, 2000, 2001, 2002 |
3 | Free Software Foundation, Inc. | |
252b5132 RH |
4 | Contributed by Ian Lance Taylor, Cygnus Support. |
5 | ||
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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
21 | ||
22 | #include "bfd.h" | |
23 | #include "sysdep.h" | |
24 | #include "libbfd.h" | |
25 | ||
26 | /* The common PowerPC architecture is compatible with the RS/6000. */ | |
27 | ||
28 | static const bfd_arch_info_type *powerpc_compatible | |
29 | PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); | |
30 | ||
31 | static const bfd_arch_info_type * | |
32 | powerpc_compatible (a,b) | |
33 | const bfd_arch_info_type *a; | |
34 | const bfd_arch_info_type *b; | |
35 | { | |
36 | BFD_ASSERT (a->arch == bfd_arch_powerpc); | |
37 | switch (b->arch) | |
38 | { | |
39 | default: | |
40 | return NULL; | |
41 | case bfd_arch_powerpc: | |
42 | return bfd_default_compatible (a, b); | |
43 | case bfd_arch_rs6000: | |
44 | if (a->mach == 0) | |
45 | return a; | |
46 | return NULL; | |
47 | } | |
48 | /*NOTREACHED*/ | |
49 | } | |
50 | ||
899f54f5 | 51 | const bfd_arch_info_type bfd_powerpc_archs[] = |
252b5132 | 52 | { |
feee612b AM |
53 | #if BFD_DEFAULT_TARGET_SIZE == 64 |
54 | /* Default arch must come first. */ | |
99dc0092 AM |
55 | { |
56 | 64, /* 64 bits in a word */ | |
57 | 64, /* 64 bits in an address */ | |
58 | 8, /* 8 bits in a byte */ | |
59 | bfd_arch_powerpc, | |
60 | bfd_mach_ppc64, | |
61 | "powerpc", | |
62 | "powerpc:common64", | |
63 | 3, | |
64 | true, /* default for 64 bit target */ | |
65 | powerpc_compatible, | |
66 | bfd_default_scan, | |
67 | &bfd_powerpc_archs[1] | |
68 | }, | |
feee612b AM |
69 | /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch |
70 | being immediately after the 64 bit default. */ | |
99dc0092 AM |
71 | { |
72 | 32, /* 32 bits in a word */ | |
73 | 32, /* 32 bits in an address */ | |
74 | 8, /* 8 bits in a byte */ | |
75 | bfd_arch_powerpc, | |
76 | bfd_mach_ppc, /* for the POWER/PowerPC common architecture */ | |
77 | "powerpc", | |
78 | "powerpc:common", | |
79 | 3, | |
80 | false, | |
81 | powerpc_compatible, | |
82 | bfd_default_scan, | |
83 | &bfd_powerpc_archs[2], | |
84 | }, | |
85 | #else | |
feee612b | 86 | /* Default arch must come first. */ |
99dc0092 AM |
87 | { |
88 | 32, /* 32 bits in a word */ | |
89 | 32, /* 32 bits in an address */ | |
90 | 8, /* 8 bits in a byte */ | |
91 | bfd_arch_powerpc, | |
92 | bfd_mach_ppc, /* for the POWER/PowerPC common architecture */ | |
93 | "powerpc", | |
94 | "powerpc:common", | |
95 | 3, | |
96 | true, /* default for 32 bit target */ | |
97 | powerpc_compatible, | |
98 | bfd_default_scan, | |
99 | &bfd_powerpc_archs[1], | |
100 | }, | |
feee612b AM |
101 | /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch |
102 | being immediately after the 32 bit default. */ | |
99dc0092 AM |
103 | { |
104 | 64, /* 64 bits in a word */ | |
105 | 64, /* 64 bits in an address */ | |
106 | 8, /* 8 bits in a byte */ | |
107 | bfd_arch_powerpc, | |
108 | bfd_mach_ppc64, | |
109 | "powerpc", | |
110 | "powerpc:common64", | |
111 | 3, | |
112 | false, | |
113 | powerpc_compatible, | |
114 | bfd_default_scan, | |
115 | &bfd_powerpc_archs[2] | |
116 | }, | |
117 | #endif | |
252b5132 RH |
118 | { |
119 | 32, /* 32 bits in a word */ | |
120 | 32, /* 32 bits in an address */ | |
121 | 8, /* 8 bits in a byte */ | |
122 | bfd_arch_powerpc, | |
87f33987 | 123 | bfd_mach_ppc_603, |
252b5132 RH |
124 | "powerpc", |
125 | "powerpc:603", | |
126 | 3, | |
127 | false, /* not the default */ | |
71f6b586 | 128 | powerpc_compatible, |
252b5132 | 129 | bfd_default_scan, |
99dc0092 | 130 | &bfd_powerpc_archs[3] |
252b5132 RH |
131 | }, |
132 | { | |
133 | 32, /* 32 bits in a word */ | |
134 | 32, /* 32 bits in an address */ | |
135 | 8, /* 8 bits in a byte */ | |
136 | bfd_arch_powerpc, | |
87f33987 | 137 | bfd_mach_ppc_ec603e, |
252b5132 | 138 | "powerpc", |
87f33987 | 139 | "powerpc:EC603e", |
252b5132 RH |
140 | 3, |
141 | false, /* not the default */ | |
71f6b586 | 142 | powerpc_compatible, |
252b5132 | 143 | bfd_default_scan, |
99dc0092 | 144 | &bfd_powerpc_archs[4] |
252b5132 RH |
145 | }, |
146 | { | |
147 | 32, /* 32 bits in a word */ | |
148 | 32, /* 32 bits in an address */ | |
149 | 8, /* 8 bits in a byte */ | |
150 | bfd_arch_powerpc, | |
87f33987 | 151 | bfd_mach_ppc_604, |
252b5132 | 152 | "powerpc", |
87f33987 | 153 | "powerpc:604", |
252b5132 RH |
154 | 3, |
155 | false, /* not the default */ | |
71f6b586 | 156 | powerpc_compatible, |
252b5132 | 157 | bfd_default_scan, |
99dc0092 | 158 | &bfd_powerpc_archs[5] |
252b5132 RH |
159 | }, |
160 | { | |
161 | 32, /* 32 bits in a word */ | |
162 | 32, /* 32 bits in an address */ | |
163 | 8, /* 8 bits in a byte */ | |
164 | bfd_arch_powerpc, | |
87f33987 | 165 | bfd_mach_ppc_403, |
252b5132 | 166 | "powerpc", |
87f33987 | 167 | "powerpc:403", |
252b5132 RH |
168 | 3, |
169 | false, /* not the default */ | |
71f6b586 | 170 | powerpc_compatible, |
252b5132 | 171 | bfd_default_scan, |
99dc0092 | 172 | &bfd_powerpc_archs[6] |
7f6d05e8 | 173 | }, |
87f33987 | 174 | { |
7f6d05e8 | 175 | 32, /* 32 bits in a word */ |
87f33987 ND |
176 | 32, /* 32 bits in an address */ |
177 | 8, /* 8 bits in a byte */ | |
178 | bfd_arch_powerpc, | |
179 | bfd_mach_ppc_601, | |
180 | "powerpc", | |
181 | "powerpc:601", | |
182 | 3, | |
183 | false, /* not the default */ | |
71f6b586 | 184 | powerpc_compatible, |
87f33987 | 185 | bfd_default_scan, |
99dc0092 | 186 | &bfd_powerpc_archs[7] |
87f33987 | 187 | }, |
71f6b586 | 188 | { |
87f33987 | 189 | 64, /* 64 bits in a word */ |
7f6d05e8 CP |
190 | 64, /* 64 bits in an address */ |
191 | 8, /* 8 bits in a byte */ | |
192 | bfd_arch_powerpc, | |
87f33987 | 193 | bfd_mach_ppc_620, |
7f6d05e8 CP |
194 | "powerpc", |
195 | "powerpc:620", | |
196 | 3, | |
899f54f5 | 197 | false, /* not the default */ |
71f6b586 | 198 | powerpc_compatible, |
7f6d05e8 | 199 | bfd_default_scan, |
99dc0092 | 200 | &bfd_powerpc_archs[8] |
87f33987 ND |
201 | }, |
202 | { | |
203 | 64, /* 64 bits in a word */ | |
204 | 64, /* 64 bits in an address */ | |
205 | 8, /* 8 bits in a byte */ | |
206 | bfd_arch_powerpc, | |
207 | bfd_mach_ppc_630, | |
208 | "powerpc", | |
209 | "powerpc:630", | |
210 | 3, | |
211 | false, /* not the default */ | |
212 | powerpc_compatible, | |
213 | bfd_default_scan, | |
99dc0092 | 214 | &bfd_powerpc_archs[9] |
87f33987 ND |
215 | }, |
216 | { | |
217 | 64, /* 64 bits in a word */ | |
218 | 64, /* 64 bits in an address */ | |
219 | 8, /* 8 bits in a byte */ | |
220 | bfd_arch_powerpc, | |
221 | bfd_mach_ppc_a35, | |
222 | "powerpc", | |
223 | "powerpc:a35", | |
224 | 3, | |
225 | false, /* not the default */ | |
226 | powerpc_compatible, | |
227 | bfd_default_scan, | |
99dc0092 | 228 | &bfd_powerpc_archs[10] |
87f33987 ND |
229 | }, |
230 | { | |
231 | 64, /* 64 bits in a word */ | |
232 | 64, /* 64 bits in an address */ | |
233 | 8, /* 8 bits in a byte */ | |
234 | bfd_arch_powerpc, | |
235 | bfd_mach_ppc_rs64ii, | |
236 | "powerpc", | |
237 | "powerpc:rs64ii", | |
238 | 3, | |
239 | false, /* not the default */ | |
240 | powerpc_compatible, | |
241 | bfd_default_scan, | |
99dc0092 | 242 | &bfd_powerpc_archs[11] |
87f33987 ND |
243 | }, |
244 | { | |
245 | 64, /* 64 bits in a word */ | |
246 | 64, /* 64 bits in an address */ | |
247 | 8, /* 8 bits in a byte */ | |
248 | bfd_arch_powerpc, | |
249 | bfd_mach_ppc_rs64iii, | |
250 | "powerpc", | |
251 | "powerpc:rs64iii", | |
252 | 3, | |
253 | false, /* not the default */ | |
254 | powerpc_compatible, | |
255 | bfd_default_scan, | |
99dc0092 | 256 | &bfd_powerpc_archs[12] |
87f33987 ND |
257 | }, |
258 | { | |
259 | 32, /* 32 bits in a word */ | |
260 | 32, /* 32 bits in an address */ | |
261 | 8, /* 8 bits in a byte */ | |
262 | bfd_arch_powerpc, | |
263 | bfd_mach_ppc_7400, | |
264 | "powerpc", | |
265 | "powerpc:7400", | |
266 | 3, | |
267 | false, /* not the default */ | |
268 | powerpc_compatible, | |
269 | bfd_default_scan, | |
99dc0092 | 270 | &bfd_powerpc_archs[13] |
188ac662 GK |
271 | }, |
272 | { | |
273 | 32, /* 32 bits in a word */ | |
274 | 32, /* 32 bits in an address */ | |
275 | 8, /* 8 bits in a byte */ | |
276 | bfd_arch_powerpc, | |
277 | bfd_mach_ppc_860, | |
278 | "powerpc", | |
279 | "powerpc:MPC8XX", | |
280 | 3, | |
281 | false, /* not the default */ | |
282 | powerpc_compatible, | |
283 | bfd_default_scan, | |
899f54f5 AM |
284 | 0 |
285 | } | |
286 | }; |