Back to index

cell-binutils  2.17cvs20070401
cpu-powerpc.c
Go to the documentation of this file.
00001 /* BFD PowerPC CPU definition
00002    Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003
00003    Free Software Foundation, Inc.
00004    Contributed by Ian Lance Taylor, Cygnus Support.
00005 
00006 This file is part of BFD, the Binary File Descriptor library.
00007 
00008 This program is free software; you can redistribute it and/or modify
00009 it under the terms of the GNU General Public License as published by
00010 the Free Software Foundation; either version 2 of the License, or
00011 (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00021 
00022 #include "bfd.h"
00023 #include "sysdep.h"
00024 #include "libbfd.h"
00025 
00026 /* The common PowerPC architecture is compatible with the RS/6000.  */
00027 
00028 static const bfd_arch_info_type *powerpc_compatible
00029   PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
00030 
00031 static const bfd_arch_info_type *
00032 powerpc_compatible (a,b)
00033      const bfd_arch_info_type *a;
00034      const bfd_arch_info_type *b;
00035 {
00036   BFD_ASSERT (a->arch == bfd_arch_powerpc);
00037   switch (b->arch)
00038     {
00039     default:
00040       return NULL;
00041     case bfd_arch_powerpc:
00042       return bfd_default_compatible (a, b);
00043     case bfd_arch_rs6000:
00044       if (b->mach == bfd_mach_rs6k)
00045        return a;
00046       return NULL;
00047     }
00048   /*NOTREACHED*/
00049 }
00050 
00051 const bfd_arch_info_type bfd_powerpc_archs[] =
00052 {
00053 #if BFD_DEFAULT_TARGET_SIZE == 64
00054   /* Default arch must come first.  */
00055   {
00056     64,       /* 64 bits in a word */
00057     64,       /* 64 bits in an address */
00058     8, /* 8 bits in a byte */
00059     bfd_arch_powerpc,
00060     bfd_mach_ppc64,
00061     "powerpc",
00062     "powerpc:common64",
00063     3,
00064     TRUE, /* default for 64 bit target */
00065     powerpc_compatible,
00066     bfd_default_scan,
00067     &bfd_powerpc_archs[1]
00068   },
00069   /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
00070      being immediately after the 64 bit default.  */
00071   {
00072     32,       /* 32 bits in a word */
00073     32,       /* 32 bits in an address */
00074     8, /* 8 bits in a byte */
00075     bfd_arch_powerpc,
00076     bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
00077     "powerpc",
00078     "powerpc:common",
00079     3,
00080     FALSE,
00081     powerpc_compatible,
00082     bfd_default_scan,
00083     &bfd_powerpc_archs[2],
00084   },
00085 #else
00086   /* Default arch must come first.  */
00087   {
00088     32,       /* 32 bits in a word */
00089     32,       /* 32 bits in an address */
00090     8, /* 8 bits in a byte */
00091     bfd_arch_powerpc,
00092     bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
00093     "powerpc",
00094     "powerpc:common",
00095     3,
00096     TRUE, /* default for 32 bit target */
00097     powerpc_compatible,
00098     bfd_default_scan,
00099     &bfd_powerpc_archs[1],
00100   },
00101   /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
00102      being immediately after the 32 bit default.  */
00103   {
00104     64,       /* 64 bits in a word */
00105     64,       /* 64 bits in an address */
00106     8, /* 8 bits in a byte */
00107     bfd_arch_powerpc,
00108     bfd_mach_ppc64,
00109     "powerpc",
00110     "powerpc:common64",
00111     3,
00112     FALSE,
00113     powerpc_compatible,
00114     bfd_default_scan,
00115     &bfd_powerpc_archs[2]
00116   },
00117 #endif
00118   {
00119     32,       /* 32 bits in a word */
00120     32,       /* 32 bits in an address */
00121     8, /* 8 bits in a byte */
00122     bfd_arch_powerpc,
00123     bfd_mach_ppc_603,
00124     "powerpc",
00125     "powerpc:603",
00126     3,
00127     FALSE, /* not the default */
00128     powerpc_compatible,
00129     bfd_default_scan,
00130     &bfd_powerpc_archs[3]
00131   },
00132   {
00133     32,       /* 32 bits in a word */
00134     32,       /* 32 bits in an address */
00135     8, /* 8 bits in a byte */
00136     bfd_arch_powerpc,
00137     bfd_mach_ppc_ec603e,
00138     "powerpc",
00139     "powerpc:EC603e",
00140     3,
00141     FALSE, /* not the default */
00142     powerpc_compatible,
00143     bfd_default_scan,
00144     &bfd_powerpc_archs[4]
00145   },
00146   {
00147     32,       /* 32 bits in a word */
00148     32,       /* 32 bits in an address */
00149     8, /* 8 bits in a byte */
00150     bfd_arch_powerpc,
00151     bfd_mach_ppc_604,
00152     "powerpc",
00153     "powerpc:604",
00154     3,
00155     FALSE, /* not the default */
00156     powerpc_compatible,
00157     bfd_default_scan,
00158     &bfd_powerpc_archs[5]
00159   },
00160   {
00161     32,       /* 32 bits in a word */
00162     32,       /* 32 bits in an address */
00163     8, /* 8 bits in a byte */
00164     bfd_arch_powerpc,
00165     bfd_mach_ppc_403,
00166     "powerpc",
00167     "powerpc:403",
00168     3,
00169     FALSE, /* not the default */
00170     powerpc_compatible,
00171     bfd_default_scan,
00172     &bfd_powerpc_archs[6]
00173   },
00174   {
00175     32,       /* 32 bits in a word */
00176     32,       /* 32 bits in an address */
00177     8, /* 8 bits in a byte */
00178     bfd_arch_powerpc,
00179     bfd_mach_ppc_601,
00180     "powerpc",
00181     "powerpc:601",
00182     3,
00183     FALSE, /* not the default */
00184     powerpc_compatible,
00185     bfd_default_scan,
00186     &bfd_powerpc_archs[7]
00187   },
00188   {
00189     64,       /* 64 bits in a word */
00190     64,       /* 64 bits in an address */
00191     8, /* 8 bits in a byte */
00192     bfd_arch_powerpc,
00193     bfd_mach_ppc_620,
00194     "powerpc",
00195     "powerpc:620",
00196     3,
00197     FALSE, /* not the default */
00198     powerpc_compatible,
00199     bfd_default_scan,
00200     &bfd_powerpc_archs[8]
00201   },
00202   {
00203     64,       /* 64 bits in a word */
00204     64,       /* 64 bits in an address */
00205     8, /* 8 bits in a byte */
00206     bfd_arch_powerpc,
00207     bfd_mach_ppc_630,
00208     "powerpc",
00209     "powerpc:630",
00210     3,
00211     FALSE, /* not the default */
00212     powerpc_compatible,
00213     bfd_default_scan,
00214     &bfd_powerpc_archs[9]
00215   },
00216   {
00217     64,       /* 64 bits in a word */
00218     64,       /* 64 bits in an address */
00219     8, /* 8 bits in a byte */
00220     bfd_arch_powerpc,
00221     bfd_mach_ppc_a35,
00222     "powerpc",
00223     "powerpc:a35",
00224     3,
00225     FALSE, /* not the default */
00226     powerpc_compatible,
00227     bfd_default_scan,
00228     &bfd_powerpc_archs[10]
00229   },
00230   {
00231     64,       /* 64 bits in a word */
00232     64,       /* 64 bits in an address */
00233     8, /* 8 bits in a byte */
00234     bfd_arch_powerpc,
00235     bfd_mach_ppc_rs64ii,
00236     "powerpc",
00237     "powerpc:rs64ii",
00238     3,
00239     FALSE, /* not the default */
00240     powerpc_compatible,
00241     bfd_default_scan,
00242     &bfd_powerpc_archs[11]
00243   },
00244   {
00245     64,       /* 64 bits in a word */
00246     64,       /* 64 bits in an address */
00247     8, /* 8 bits in a byte */
00248     bfd_arch_powerpc,
00249     bfd_mach_ppc_rs64iii,
00250     "powerpc",
00251     "powerpc:rs64iii",
00252     3,
00253     FALSE, /* not the default */
00254     powerpc_compatible,
00255     bfd_default_scan,
00256     &bfd_powerpc_archs[12]
00257   },
00258   {
00259     32,       /* 32 bits in a word */
00260     32,       /* 32 bits in an address */
00261     8, /* 8 bits in a byte */
00262     bfd_arch_powerpc,
00263     bfd_mach_ppc_7400,
00264     "powerpc",
00265     "powerpc:7400",
00266     3,
00267     FALSE, /* not the default */
00268     powerpc_compatible,
00269     bfd_default_scan,
00270     &bfd_powerpc_archs[13]
00271   },
00272   {
00273     32, /* 32 bits in a word */
00274     32, /* 32 bits in an address */
00275     8,  /* 8 bits in a byte */
00276     bfd_arch_powerpc,
00277     bfd_mach_ppc_e500,
00278     "powerpc",
00279     "powerpc:e500",
00280     3,
00281     FALSE,
00282     powerpc_compatible,
00283     bfd_default_scan,
00284     &bfd_powerpc_archs[14]
00285   },
00286   {
00287     32,       /* 32 bits in a word */
00288     32,       /* 32 bits in an address */
00289     8,        /* 8 bits in a byte */
00290     bfd_arch_powerpc,
00291     bfd_mach_ppc_860,
00292     "powerpc",
00293     "powerpc:MPC8XX",
00294     3,
00295     FALSE, /* not the default */
00296     powerpc_compatible,
00297     bfd_default_scan,
00298     &bfd_powerpc_archs[15]
00299   },
00300   {
00301     32, /* 32 bits in a word */
00302     32, /* 32 bits in an address */
00303     8,  /* 8 bits in a byte */
00304     bfd_arch_powerpc,
00305     bfd_mach_ppc_750,
00306     "powerpc",
00307     "powerpc:750",
00308     3,
00309     FALSE, /* not the default */
00310     powerpc_compatible,
00311     bfd_default_scan,
00312     0
00313   }
00314 };