cpu-sparc.c revision 59024
159024Sobrien/* BFD support for the SPARC architecture.
259024Sobrien   Copyright (C) 1992, 94, 95, 96, 1997 Free Software Foundation, Inc.
359024Sobrien
459024SobrienThis file is part of BFD, the Binary File Descriptor library.
559024Sobrien
659024SobrienThis program is free software; you can redistribute it and/or modify
759024Sobrienit under the terms of the GNU General Public License as published by
859024Sobrienthe Free Software Foundation; either version 2 of the License, or
959024Sobrien(at your option) any later version.
1059024Sobrien
1159024SobrienThis program is distributed in the hope that it will be useful,
1259024Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1359024SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1459024SobrienGNU General Public License for more details.
1559024Sobrien
1659024SobrienYou should have received a copy of the GNU General Public License
1759024Sobrienalong with this program; if not, write to the Free Software
1859024SobrienFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
1959024Sobrien
2059024Sobrien#include "bfd.h"
2159024Sobrien#include "sysdep.h"
2259024Sobrien#include "libbfd.h"
2359024Sobrien
2459024Sobrien/* Don't mix 32 bit and 64 bit files.  */
2559024Sobrien
2659024Sobrienstatic const bfd_arch_info_type *sparc_compatible
2759024Sobrien  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
2859024Sobrien
2959024Sobrienstatic const bfd_arch_info_type *
3059024Sobriensparc_compatible (a, b)
3159024Sobrien     const bfd_arch_info_type *a;
3259024Sobrien     const bfd_arch_info_type *b;
3359024Sobrien{
3459024Sobrien  if (a->bits_per_word != b->bits_per_word)
3559024Sobrien    return NULL;
3659024Sobrien
3759024Sobrien  return bfd_default_compatible (a, b);
3859024Sobrien}
3959024Sobrien
4059024Sobrienstatic const bfd_arch_info_type arch_info_struct[] =
4159024Sobrien{
4259024Sobrien  {
4359024Sobrien    32,	/* bits in a word */
4459024Sobrien    32,	/* bits in an address */
4559024Sobrien    8,	/* bits in a byte */
4659024Sobrien    bfd_arch_sparc,
4759024Sobrien    bfd_mach_sparc_sparclet,
4859024Sobrien    "sparc",
4959024Sobrien    "sparc:sparclet",
5059024Sobrien    3,
5159024Sobrien    false,
5259024Sobrien    sparc_compatible,
5359024Sobrien    bfd_default_scan,
5459024Sobrien    &arch_info_struct[1],
5559024Sobrien  },
5659024Sobrien  {
5759024Sobrien    32,	/* bits in a word */
5859024Sobrien    32,	/* bits in an address */
5959024Sobrien    8,	/* bits in a byte */
6059024Sobrien    bfd_arch_sparc,
6159024Sobrien    bfd_mach_sparc_sparclite,
6259024Sobrien    "sparc",
6359024Sobrien    "sparc:sparclite",
6459024Sobrien    3,
6559024Sobrien    false,
6659024Sobrien    sparc_compatible,
6759024Sobrien    bfd_default_scan,
6859024Sobrien    &arch_info_struct[2],
6959024Sobrien  },
7059024Sobrien  {
7159024Sobrien    32,	/* bits in a word */
7259024Sobrien    32,	/* bits in an address */
7359024Sobrien    8,	/* bits in a byte */
7459024Sobrien    bfd_arch_sparc,
7559024Sobrien    bfd_mach_sparc_v8plus,
7659024Sobrien    "sparc",
7759024Sobrien    "sparc:v8plus",
7859024Sobrien    3,
7959024Sobrien    false,
8059024Sobrien    sparc_compatible,
8159024Sobrien    bfd_default_scan,
8259024Sobrien    &arch_info_struct[3],
8359024Sobrien  },
8459024Sobrien  {
8559024Sobrien    32,	/* bits in a word */
8659024Sobrien    32,	/* bits in an address */
8759024Sobrien    8,	/* bits in a byte */
8859024Sobrien    bfd_arch_sparc,
8959024Sobrien    bfd_mach_sparc_v8plusa,
9059024Sobrien    "sparc",
9159024Sobrien    "sparc:v8plusa",
9259024Sobrien    3,
9359024Sobrien    false,
9459024Sobrien    sparc_compatible,
9559024Sobrien    bfd_default_scan,
9659024Sobrien    &arch_info_struct[4],
9759024Sobrien  },
9859024Sobrien  {
9959024Sobrien    64,	/* bits in a word */
10059024Sobrien    64,	/* bits in an address */
10159024Sobrien    8,	/* bits in a byte */
10259024Sobrien    bfd_arch_sparc,
10359024Sobrien    bfd_mach_sparc_v9,
10459024Sobrien    "sparc",
10559024Sobrien    "sparc:v9",
10659024Sobrien    3,
10759024Sobrien    false,
10859024Sobrien    sparc_compatible,
10959024Sobrien    bfd_default_scan,
11059024Sobrien    &arch_info_struct[5],
11159024Sobrien  },
11259024Sobrien  {
11359024Sobrien    64,	/* bits in a word */
11459024Sobrien    64,	/* bits in an address */
11559024Sobrien    8,	/* bits in a byte */
11659024Sobrien    bfd_arch_sparc,
11759024Sobrien    bfd_mach_sparc_v9a,
11859024Sobrien    "sparc",
11959024Sobrien    "sparc:v9a",
12059024Sobrien    3,
12159024Sobrien    false,
12259024Sobrien    sparc_compatible,
12359024Sobrien    bfd_default_scan,
12459024Sobrien    0,
12559024Sobrien  }
12659024Sobrien};
12759024Sobrien
12859024Sobrienconst bfd_arch_info_type bfd_sparc_arch =
12959024Sobrien  {
13059024Sobrien    32,	/* bits in a word */
13159024Sobrien    32,	/* bits in an address */
13259024Sobrien    8,	/* bits in a byte */
13359024Sobrien    bfd_arch_sparc,
13459024Sobrien    bfd_mach_sparc,
13559024Sobrien    "sparc",
13659024Sobrien    "sparc",
13759024Sobrien    3,
13859024Sobrien    true, /* the default */
13959024Sobrien    sparc_compatible,
14059024Sobrien    bfd_default_scan,
14159024Sobrien    &arch_info_struct[0],
14259024Sobrien  };
143