]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD back-end for rs6000 support |
aa820537 | 2 | Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003, 2005, 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 | ||
cd123cb7 | 7 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 8 | |
cd123cb7 NC |
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 3 of the License, or | |
12 | (at your option) any later version. | |
252b5132 | 13 | |
cd123cb7 NC |
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. | |
252b5132 | 18 | |
cd123cb7 NC |
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 | |
21 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
22 | MA 02110-1301, USA. */ | |
252b5132 | 23 | |
252b5132 | 24 | #include "sysdep.h" |
3db64b00 | 25 | #include "bfd.h" |
252b5132 RH |
26 | #include "libbfd.h" |
27 | ||
28 | /* The RS/6000 architecture is compatible with the PowerPC common | |
29 | architecture. */ | |
30 | ||
31 | static const bfd_arch_info_type *rs6000_compatible | |
32 | PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); | |
33 | ||
34 | static const bfd_arch_info_type * | |
35 | rs6000_compatible (a,b) | |
36 | const bfd_arch_info_type *a; | |
37 | const bfd_arch_info_type *b; | |
38 | { | |
39 | BFD_ASSERT (a->arch == bfd_arch_rs6000); | |
40 | switch (b->arch) | |
41 | { | |
42 | default: | |
43 | return NULL; | |
44 | case bfd_arch_rs6000: | |
45 | return bfd_default_compatible (a, b); | |
46 | case bfd_arch_powerpc: | |
3f8b3ef3 | 47 | if (a->mach == bfd_mach_rs6k) |
252b5132 RH |
48 | return b; |
49 | return NULL; | |
50 | } | |
51 | /*NOTREACHED*/ | |
52 | } | |
53 | ||
87f33987 ND |
54 | static const bfd_arch_info_type arch_info_struct[] = |
55 | { | |
56 | { | |
57 | 32, /* 32 bits in a word */ | |
58 | 32, /* 32 bits in an address */ | |
59 | 8, /* 8 bits in a byte */ | |
60 | bfd_arch_rs6000, | |
61 | bfd_mach_rs6k_rs1, | |
62 | "rs6000", | |
63 | "rs6000:rs1", | |
64 | 3, | |
b34976b6 | 65 | FALSE, /* not the default */ |
87f33987 ND |
66 | rs6000_compatible, |
67 | bfd_default_scan, | |
b7761f11 | 68 | bfd_arch_default_fill, |
87f33987 ND |
69 | &arch_info_struct[1] |
70 | }, | |
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_rs6000, | |
76 | bfd_mach_rs6k_rsc, | |
77 | "rs6000", | |
78 | "rs6000:rsc", | |
79 | 3, | |
b34976b6 | 80 | FALSE, /* not the default */ |
87f33987 ND |
81 | rs6000_compatible, |
82 | bfd_default_scan, | |
b7761f11 | 83 | bfd_arch_default_fill, |
87f33987 ND |
84 | &arch_info_struct[2] |
85 | }, | |
86 | { | |
87 | 32, /* 32 bits in a word */ | |
88 | 32, /* 32 bits in an address */ | |
89 | 8, /* 8 bits in a byte */ | |
90 | bfd_arch_rs6000, | |
91 | bfd_mach_rs6k_rs2, | |
92 | "rs6000", | |
93 | "rs6000:rs2", | |
94 | 3, | |
b34976b6 | 95 | FALSE, /* not the default */ |
87f33987 ND |
96 | rs6000_compatible, |
97 | bfd_default_scan, | |
b7761f11 | 98 | bfd_arch_default_fill, |
87f33987 ND |
99 | 0 |
100 | } | |
101 | }; | |
102 | ||
252b5132 RH |
103 | const bfd_arch_info_type bfd_rs6000_arch = |
104 | { | |
105 | 32, /* 32 bits in a word */ | |
106 | 32, /* 32 bits in an address */ | |
107 | 8, /* 8 bits in a byte */ | |
108 | bfd_arch_rs6000, | |
87f33987 | 109 | bfd_mach_rs6k, /* POWER common architecture */ |
252b5132 RH |
110 | "rs6000", |
111 | "rs6000:6000", | |
112 | 3, | |
b34976b6 | 113 | TRUE, /* the default */ |
252b5132 RH |
114 | rs6000_compatible, |
115 | bfd_default_scan, | |
b7761f11 | 116 | bfd_arch_default_fill, |
87f33987 | 117 | &arch_info_struct[0] |
252b5132 | 118 | }; |