Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD back-end for rs6000 support |
3db64b00 | 2 | Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2007 |
b34976b6 | 3 | Free Software Foundation, Inc. |
2ce18a16 | 4 | Written by Mimi Phuong-Thao Vo of IBM |
252b5132 RH |
5 | and John Gilmore of Cygnus Support. |
6 | ||
7 | This file is part of BFD, the Binary File Descriptor library. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with this program; if not, write to the Free Software | |
3e110533 | 21 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 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 RS/6000 architecture is compatible with the PowerPC common | |
28 | architecture. */ | |
29 | ||
30 | static const bfd_arch_info_type *rs6000_compatible | |
31 | PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); | |
32 | ||
33 | static const bfd_arch_info_type * | |
34 | rs6000_compatible (a,b) | |
35 | const bfd_arch_info_type *a; | |
36 | const bfd_arch_info_type *b; | |
37 | { | |
38 | BFD_ASSERT (a->arch == bfd_arch_rs6000); | |
39 | switch (b->arch) | |
40 | { | |
41 | default: | |
42 | return NULL; | |
43 | case bfd_arch_rs6000: | |
44 | return bfd_default_compatible (a, b); | |
45 | case bfd_arch_powerpc: | |
3f8b3ef3 | 46 | if (a->mach == bfd_mach_rs6k) |
252b5132 RH |
47 | return b; |
48 | return NULL; | |
49 | } | |
50 | /*NOTREACHED*/ | |
51 | } | |
52 | ||
87f33987 ND |
53 | static const bfd_arch_info_type arch_info_struct[] = |
54 | { | |
55 | { | |
56 | 32, /* 32 bits in a word */ | |
57 | 32, /* 32 bits in an address */ | |
58 | 8, /* 8 bits in a byte */ | |
59 | bfd_arch_rs6000, | |
60 | bfd_mach_rs6k_rs1, | |
61 | "rs6000", | |
62 | "rs6000:rs1", | |
63 | 3, | |
b34976b6 | 64 | FALSE, /* not the default */ |
87f33987 ND |
65 | rs6000_compatible, |
66 | bfd_default_scan, | |
67 | &arch_info_struct[1] | |
68 | }, | |
69 | { | |
70 | 32, /* 32 bits in a word */ | |
71 | 32, /* 32 bits in an address */ | |
72 | 8, /* 8 bits in a byte */ | |
73 | bfd_arch_rs6000, | |
74 | bfd_mach_rs6k_rsc, | |
75 | "rs6000", | |
76 | "rs6000:rsc", | |
77 | 3, | |
b34976b6 | 78 | FALSE, /* not the default */ |
87f33987 ND |
79 | rs6000_compatible, |
80 | bfd_default_scan, | |
81 | &arch_info_struct[2] | |
82 | }, | |
83 | { | |
84 | 32, /* 32 bits in a word */ | |
85 | 32, /* 32 bits in an address */ | |
86 | 8, /* 8 bits in a byte */ | |
87 | bfd_arch_rs6000, | |
88 | bfd_mach_rs6k_rs2, | |
89 | "rs6000", | |
90 | "rs6000:rs2", | |
91 | 3, | |
b34976b6 | 92 | FALSE, /* not the default */ |
87f33987 ND |
93 | rs6000_compatible, |
94 | bfd_default_scan, | |
95 | 0 | |
96 | } | |
97 | }; | |
98 | ||
252b5132 RH |
99 | const bfd_arch_info_type bfd_rs6000_arch = |
100 | { | |
101 | 32, /* 32 bits in a word */ | |
102 | 32, /* 32 bits in an address */ | |
103 | 8, /* 8 bits in a byte */ | |
104 | bfd_arch_rs6000, | |
87f33987 | 105 | bfd_mach_rs6k, /* POWER common architecture */ |
252b5132 RH |
106 | "rs6000", |
107 | "rs6000:6000", | |
108 | 3, | |
b34976b6 | 109 | TRUE, /* the default */ |
252b5132 RH |
110 | rs6000_compatible, |
111 | bfd_default_scan, | |
87f33987 | 112 | &arch_info_struct[0] |
252b5132 | 113 | }; |