cpu-rs6000.c revision 130561
184865Sobrien/* BFD back-end for rs6000 support 2130561Sobrien Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003 3130561Sobrien Free Software Foundation, Inc. 484865Sobrien FIXME: Can someone provide a transliteration of this name into ASCII? 584865Sobrien Using the following chars caused a compiler warning on HIUX (so I replaced 684865Sobrien them with octal escapes), and isn't useful without an understanding of what 784865Sobrien character set it is. 884865Sobrien Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM 984865Sobrien and John Gilmore of Cygnus Support. 1084865Sobrien 1184865SobrienThis file is part of BFD, the Binary File Descriptor library. 1284865Sobrien 1384865SobrienThis program is free software; you can redistribute it and/or modify 1484865Sobrienit under the terms of the GNU General Public License as published by 1584865Sobrienthe Free Software Foundation; either version 2 of the License, or 1684865Sobrien(at your option) any later version. 1784865Sobrien 1884865SobrienThis program is distributed in the hope that it will be useful, 1984865Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 2084865SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2184865SobrienGNU General Public License for more details. 2284865Sobrien 2384865SobrienYou should have received a copy of the GNU General Public License 2484865Sobrienalong with this program; if not, write to the Free Software 2584865SobrienFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 2684865Sobrien 2784865Sobrien#include "bfd.h" 2884865Sobrien#include "sysdep.h" 2984865Sobrien#include "libbfd.h" 3084865Sobrien 3184865Sobrien/* The RS/6000 architecture is compatible with the PowerPC common 3284865Sobrien architecture. */ 3384865Sobrien 3484865Sobrienstatic const bfd_arch_info_type *rs6000_compatible 3584865Sobrien PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); 3684865Sobrien 3784865Sobrienstatic const bfd_arch_info_type * 3884865Sobrienrs6000_compatible (a,b) 3984865Sobrien const bfd_arch_info_type *a; 4084865Sobrien const bfd_arch_info_type *b; 4184865Sobrien{ 4284865Sobrien BFD_ASSERT (a->arch == bfd_arch_rs6000); 4384865Sobrien switch (b->arch) 4484865Sobrien { 4584865Sobrien default: 4684865Sobrien return NULL; 4784865Sobrien case bfd_arch_rs6000: 4884865Sobrien return bfd_default_compatible (a, b); 4984865Sobrien case bfd_arch_powerpc: 50130561Sobrien if (a->mach == bfd_mach_rs6k) 5184865Sobrien return b; 5284865Sobrien return NULL; 5384865Sobrien } 5484865Sobrien /*NOTREACHED*/ 5584865Sobrien} 5684865Sobrien 5784865Sobrienstatic const bfd_arch_info_type arch_info_struct[] = 5884865Sobrien{ 5984865Sobrien { 6084865Sobrien 32, /* 32 bits in a word */ 6184865Sobrien 32, /* 32 bits in an address */ 6284865Sobrien 8, /* 8 bits in a byte */ 6384865Sobrien bfd_arch_rs6000, 6484865Sobrien bfd_mach_rs6k_rs1, 6584865Sobrien "rs6000", 6684865Sobrien "rs6000:rs1", 6784865Sobrien 3, 68130561Sobrien FALSE, /* not the default */ 6984865Sobrien rs6000_compatible, 7084865Sobrien bfd_default_scan, 7184865Sobrien &arch_info_struct[1] 7284865Sobrien }, 7384865Sobrien { 7484865Sobrien 32, /* 32 bits in a word */ 7584865Sobrien 32, /* 32 bits in an address */ 7684865Sobrien 8, /* 8 bits in a byte */ 7784865Sobrien bfd_arch_rs6000, 7884865Sobrien bfd_mach_rs6k_rsc, 7984865Sobrien "rs6000", 8084865Sobrien "rs6000:rsc", 8184865Sobrien 3, 82130561Sobrien FALSE, /* not the default */ 8384865Sobrien rs6000_compatible, 8484865Sobrien bfd_default_scan, 8584865Sobrien &arch_info_struct[2] 8684865Sobrien }, 8784865Sobrien { 8884865Sobrien 32, /* 32 bits in a word */ 8984865Sobrien 32, /* 32 bits in an address */ 9084865Sobrien 8, /* 8 bits in a byte */ 9184865Sobrien bfd_arch_rs6000, 9284865Sobrien bfd_mach_rs6k_rs2, 9384865Sobrien "rs6000", 9484865Sobrien "rs6000:rs2", 9584865Sobrien 3, 96130561Sobrien FALSE, /* not the default */ 9784865Sobrien rs6000_compatible, 9884865Sobrien bfd_default_scan, 9984865Sobrien 0 10084865Sobrien } 10184865Sobrien}; 10284865Sobrien 10384865Sobrienconst bfd_arch_info_type bfd_rs6000_arch = 10484865Sobrien { 10584865Sobrien 32, /* 32 bits in a word */ 10684865Sobrien 32, /* 32 bits in an address */ 10784865Sobrien 8, /* 8 bits in a byte */ 10884865Sobrien bfd_arch_rs6000, 10984865Sobrien bfd_mach_rs6k, /* POWER common architecture */ 11084865Sobrien "rs6000", 11184865Sobrien "rs6000:6000", 11284865Sobrien 3, 113130561Sobrien TRUE, /* the default */ 11484865Sobrien rs6000_compatible, 11584865Sobrien bfd_default_scan, 11684865Sobrien &arch_info_struct[0] 11784865Sobrien }; 118