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