cpu-rs6000.c revision 130562
158551Skris/* BFD back-end for rs6000 support
258551Skris   Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003
3228060Sbapt   Free Software Foundation, Inc.
458551Skris   FIXME: Can someone provide a transliteration of this name into ASCII?
5228060Sbapt   Using the following chars caused a compiler warning on HIUX (so I replaced
6228060Sbapt   them with octal escapes), and isn't useful without an understanding of what
758551Skris   character set it is.
858551Skris   Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM
9228060Sbapt   and John Gilmore of Cygnus Support.
10228060Sbapt
11228060SbaptThis file is part of BFD, the Binary File Descriptor library.
1258551Skris
13228060SbaptThis program is free software; you can redistribute it and/or modify
14228060Sbaptit under the terms of the GNU General Public License as published by
15228060Sbaptthe Free Software Foundation; either version 2 of the License, or
16228060Sbapt(at your option) any later version.
17228060Sbapt
18228060SbaptThis program is distributed in the hope that it will be useful,
19228060Sbaptbut WITHOUT ANY WARRANTY; without even the implied warranty of
20228060SbaptMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21228060SbaptGNU General Public License for more details.
22228060Sbapt
23228060SbaptYou should have received a copy of the GNU General Public License
24228060Sbaptalong with this program; if not, write to the Free Software
25228060SbaptFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
26228060Sbapt
27228060Sbapt#include "bfd.h"
28228060Sbapt#include "sysdep.h"
29228060Sbapt#include "libbfd.h"
30228060Sbapt
31228060Sbapt/* The RS/6000 architecture is compatible with the PowerPC common
32228060Sbapt   architecture.  */
33228060Sbapt
34228060Sbaptstatic const bfd_arch_info_type *rs6000_compatible
35228060Sbapt  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
36228060Sbapt
37228060Sbaptstatic const bfd_arch_info_type *
38228060Sbaptrs6000_compatible (a,b)
39228060Sbapt     const bfd_arch_info_type *a;
40228060Sbapt     const bfd_arch_info_type *b;
41228060Sbapt{
42228060Sbapt  BFD_ASSERT (a->arch == bfd_arch_rs6000);
43228060Sbapt  switch (b->arch)
44228060Sbapt    {
45228060Sbapt    default:
46228060Sbapt      return NULL;
47228060Sbapt    case bfd_arch_rs6000:
48228060Sbapt      return bfd_default_compatible (a, b);
49228060Sbapt    case bfd_arch_powerpc:
50228060Sbapt      if (a->mach == bfd_mach_rs6k)
51228060Sbapt	return b;
52228060Sbapt      return NULL;
53228060Sbapt    }
54228060Sbapt  /*NOTREACHED*/
55228060Sbapt}
56228060Sbapt
57228060Sbaptstatic const bfd_arch_info_type arch_info_struct[] =
58228060Sbapt{
59228060Sbapt  {
60228060Sbapt    32,	/* 32 bits in a word */
61228060Sbapt    32,	/* 32 bits in an address */
62228060Sbapt    8,	/* 8 bits in a byte */
63228060Sbapt    bfd_arch_rs6000,
64228060Sbapt    bfd_mach_rs6k_rs1,
65228060Sbapt    "rs6000",
66228060Sbapt    "rs6000:rs1",
67228060Sbapt    3,
68228060Sbapt    FALSE, /* not the default */
69228060Sbapt    rs6000_compatible,
70228060Sbapt    bfd_default_scan,
71228060Sbapt    &arch_info_struct[1]
72228060Sbapt  },
73228060Sbapt  {
74228060Sbapt    32,	/* 32 bits in a word */
75228060Sbapt    32,	/* 32 bits in an address */
76228060Sbapt    8,	/* 8 bits in a byte */
77228060Sbapt    bfd_arch_rs6000,
78228060Sbapt    bfd_mach_rs6k_rsc,
79228060Sbapt    "rs6000",
80228060Sbapt    "rs6000:rsc",
81228060Sbapt    3,
82228060Sbapt    FALSE, /* not the default */
83228060Sbapt    rs6000_compatible,
84228060Sbapt    bfd_default_scan,
85228060Sbapt    &arch_info_struct[2]
86228060Sbapt  },
87228060Sbapt  {
88228060Sbapt    32,	/* 32 bits in a word */
89228060Sbapt    32,	/* 32 bits in an address */
90228060Sbapt    8,	/* 8 bits in a byte */
91228060Sbapt    bfd_arch_rs6000,
92228060Sbapt    bfd_mach_rs6k_rs2,
93228060Sbapt    "rs6000",
94228060Sbapt    "rs6000:rs2",
95228060Sbapt    3,
96228060Sbapt    FALSE, /* not the default */
97228060Sbapt    rs6000_compatible,
98228060Sbapt    bfd_default_scan,
99228060Sbapt    0
100228060Sbapt  }
101228060Sbapt};
102228060Sbapt
103228060Sbaptconst bfd_arch_info_type bfd_rs6000_arch =
104228060Sbapt  {
105228060Sbapt    32,	/* 32 bits in a word */
106228060Sbapt    32,	/* 32 bits in an address */
107228060Sbapt    8,	/* 8 bits in a byte */
108228060Sbapt    bfd_arch_rs6000,
109228060Sbapt    bfd_mach_rs6k,	/* POWER common architecture */
110228060Sbapt    "rs6000",
111228060Sbapt    "rs6000:6000",
112228060Sbapt    3,
113228060Sbapt    TRUE, /* the default */
114228060Sbapt    rs6000_compatible,
115228060Sbapt    bfd_default_scan,
116228060Sbapt    &arch_info_struct[0]
117228060Sbapt  };
118228060Sbapt