1 /* BFD PowerPC CPU definition
2 Copyright (C) 1994-2019 Free Software Foundation, Inc.
3 Contributed by Ian Lance Taylor, Cygnus Support.
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
26 /* The common PowerPC architecture is compatible with the RS/6000. */
28 static const bfd_arch_info_type *
29 powerpc_compatible (const bfd_arch_info_type *a,
30 const bfd_arch_info_type *b)
32 BFD_ASSERT (a->arch == bfd_arch_powerpc);
37 case bfd_arch_powerpc:
38 if (a->mach == bfd_mach_ppc_vle && b->bits_per_word == 32)
40 if (b->mach == bfd_mach_ppc_vle && a->bits_per_word == 32)
42 return bfd_default_compatible (a, b);
44 if (b->mach == bfd_mach_rs6k)
51 const bfd_arch_info_type bfd_powerpc_archs[] =
53 #if BFD_DEFAULT_TARGET_SIZE == 64
54 /* Default arch must come first. */
56 64, /* 64 bits in a word */
57 64, /* 64 bits in an address */
58 8, /* 8 bits in a byte */
64 TRUE, /* default for 64 bit target */
67 bfd_arch_default_fill,
70 /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
71 being immediately after the 64 bit default. */
73 32, /* 32 bits in a word */
74 32, /* 32 bits in an address */
75 8, /* 8 bits in a byte */
77 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
84 bfd_arch_default_fill,
85 &bfd_powerpc_archs[2],
88 /* Default arch must come first. */
90 32, /* 32 bits in a word */
91 32, /* 32 bits in an address */
92 8, /* 8 bits in a byte */
94 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
98 TRUE, /* default for 32 bit target */
101 bfd_arch_default_fill,
102 &bfd_powerpc_archs[1],
104 /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
105 being immediately after the 32 bit default. */
107 64, /* 64 bits in a word */
108 64, /* 64 bits in an address */
109 8, /* 8 bits in a byte */
118 bfd_arch_default_fill,
119 &bfd_powerpc_archs[2]
123 32, /* 32 bits in a word */
124 32, /* 32 bits in an address */
125 8, /* 8 bits in a byte */
131 FALSE, /* not the default */
134 bfd_arch_default_fill,
135 &bfd_powerpc_archs[3]
138 32, /* 32 bits in a word */
139 32, /* 32 bits in an address */
140 8, /* 8 bits in a byte */
146 FALSE, /* not the default */
149 bfd_arch_default_fill,
150 &bfd_powerpc_archs[4]
153 32, /* 32 bits in a word */
154 32, /* 32 bits in an address */
155 8, /* 8 bits in a byte */
161 FALSE, /* not the default */
164 bfd_arch_default_fill,
165 &bfd_powerpc_archs[5]
168 32, /* 32 bits in a word */
169 32, /* 32 bits in an address */
170 8, /* 8 bits in a byte */
176 FALSE, /* not the default */
179 bfd_arch_default_fill,
180 &bfd_powerpc_archs[6]
183 32, /* 32 bits in a word */
184 32, /* 32 bits in an address */
185 8, /* 8 bits in a byte */
191 FALSE, /* not the default */
194 bfd_arch_default_fill,
195 &bfd_powerpc_archs[7]
198 64, /* 64 bits in a word */
199 64, /* 64 bits in an address */
200 8, /* 8 bits in a byte */
206 FALSE, /* not the default */
209 bfd_arch_default_fill,
210 &bfd_powerpc_archs[8]
213 64, /* 64 bits in a word */
214 64, /* 64 bits in an address */
215 8, /* 8 bits in a byte */
221 FALSE, /* not the default */
224 bfd_arch_default_fill,
225 &bfd_powerpc_archs[9]
228 64, /* 64 bits in a word */
229 64, /* 64 bits in an address */
230 8, /* 8 bits in a byte */
236 FALSE, /* not the default */
239 bfd_arch_default_fill,
240 &bfd_powerpc_archs[10]
243 64, /* 64 bits in a word */
244 64, /* 64 bits in an address */
245 8, /* 8 bits in a byte */
251 FALSE, /* not the default */
254 bfd_arch_default_fill,
255 &bfd_powerpc_archs[11]
258 64, /* 64 bits in a word */
259 64, /* 64 bits in an address */
260 8, /* 8 bits in a byte */
262 bfd_mach_ppc_rs64iii,
266 FALSE, /* not the default */
269 bfd_arch_default_fill,
270 &bfd_powerpc_archs[12]
273 32, /* 32 bits in a word */
274 32, /* 32 bits in an address */
275 8, /* 8 bits in a byte */
281 FALSE, /* not the default */
284 bfd_arch_default_fill,
285 &bfd_powerpc_archs[13]
288 32, /* 32 bits in a word */
289 32, /* 32 bits in an address */
290 8, /* 8 bits in a byte */
299 bfd_arch_default_fill,
300 &bfd_powerpc_archs[14]
303 32, /* 32 bits in a word */
304 32, /* 32 bits in an address */
305 8, /* 8 bits in a byte */
311 FALSE, /* not the default */
314 bfd_arch_default_fill,
315 &bfd_powerpc_archs[15]
318 64, /* 64 bits in a word */
319 64, /* 64 bits in an address */
320 8, /* 8 bits in a byte */
322 bfd_mach_ppc_e500mc64,
326 FALSE, /* not the default */
329 bfd_arch_default_fill,
330 &bfd_powerpc_archs[16]
333 32, /* 32 bits in a word */
334 32, /* 32 bits in an address */
335 8, /* 8 bits in a byte */
341 FALSE, /* not the default */
344 bfd_arch_default_fill,
345 &bfd_powerpc_archs[17]
348 32, /* 32 bits in a word */
349 32, /* 32 bits in an address */
350 8, /* 8 bits in a byte */
356 FALSE, /* not the default */
359 bfd_arch_default_fill,
360 &bfd_powerpc_archs[18]
363 32, /* 32 bits in a word */
364 32, /* 32 bits in an address */
365 8, /* 8 bits in a byte */
371 FALSE, /* not the default */
374 bfd_arch_default_fill,
375 &bfd_powerpc_archs[19]
378 16, /* 16 or 32 bits in a word */
379 32, /* 32 bits in an address */
380 8, /* 8 bits in a byte */
386 FALSE, /* not the default */
389 bfd_arch_default_fill,
390 &bfd_powerpc_archs[20]
393 64, /* 64 bits in a word */
394 64, /* 64 bits in an address */
395 8, /* 8 bits in a byte */
401 FALSE, /* not the default */
404 bfd_arch_default_fill,
405 &bfd_powerpc_archs[21]
408 64, /* 64 bits in a word */
409 64, /* 64 bits in an address */
410 8, /* 8 bits in a byte */
416 FALSE, /* not the default */
419 bfd_arch_default_fill,