cpu-sparc.c revision 78828
160107Sobrien/* BFD support for the SPARC architecture.
216877Ssos   Copyright 1992, 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
316877Ssos
416877SsosThis file is part of BFD, the Binary File Descriptor library.
516877Ssos
616877SsosThis program is free software; you can redistribute it and/or modify
716877Ssosit under the terms of the GNU General Public License as published by
816877Ssosthe Free Software Foundation; either version 2 of the License, or
916877Ssos(at your option) any later version.
1016877Ssos
1116877SsosThis program is distributed in the hope that it will be useful,
1216877Ssosbut WITHOUT ANY WARRANTY; without even the implied warranty of
1316877SsosMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1416877SsosGNU General Public License for more details.
1516877Ssos
1616877SsosYou should have received a copy of the GNU General Public License
1716877Ssosalong with this program; if not, write to the Free Software
1816877SsosFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19117271Sache
2016877Ssos#include "bfd.h"
2116877Ssos#include "sysdep.h"
2216877Ssos#include "libbfd.h"
2316877Ssos
2416877Ssos/* Don't mix 32 bit and 64 bit files.  */
2516877Ssos
2616877Ssosstatic const bfd_arch_info_type *sparc_compatible
2716877Ssos  PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
2816877Ssos
2916877Ssosstatic const bfd_arch_info_type *
3016877Ssossparc_compatible (a, b)
3116877Ssos     const bfd_arch_info_type *a;
3216877Ssos     const bfd_arch_info_type *b;
3316877Ssos{
3416877Ssos  if (a->bits_per_word != b->bits_per_word)
3516877Ssos    return NULL;
3616877Ssos
3716877Ssos  return bfd_default_compatible (a, b);
3816877Ssos}
3916877Ssos
4016877Ssosstatic const bfd_arch_info_type arch_info_struct[] =
4116877Ssos{
4216877Ssos  {
4316877Ssos    32,	/* bits in a word */
4416877Ssos    32,	/* bits in an address */
4516877Ssos    8,	/* bits in a byte */
4616877Ssos    bfd_arch_sparc,
4716877Ssos    bfd_mach_sparc_sparclet,
4816877Ssos    "sparc",
4916877Ssos    "sparc:sparclet",
5016877Ssos    3,
5116877Ssos    false,
5216877Ssos    sparc_compatible,
5316877Ssos    bfd_default_scan,
5416877Ssos    &arch_info_struct[1],
5516877Ssos  },
5616877Ssos  {
5716877Ssos    32,	/* bits in a word */
5816877Ssos    32,	/* bits in an address */
5938140Syokota    8,	/* bits in a byte */
6016877Ssos    bfd_arch_sparc,
6116877Ssos    bfd_mach_sparc_sparclite,
6216877Ssos    "sparc",
6332822Syokota    "sparc:sparclite",
6416877Ssos    3,
6516877Ssos    false,
6616877Ssos    sparc_compatible,
6716877Ssos    bfd_default_scan,
6816877Ssos    &arch_info_struct[2],
6916877Ssos  },
7016877Ssos  {
7116877Ssos    32,	/* bits in a word */
7216877Ssos    32,	/* bits in an address */
7316877Ssos    8,	/* bits in a byte */
7416877Ssos    bfd_arch_sparc,
7516877Ssos    bfd_mach_sparc_v8plus,
7616877Ssos    "sparc",
7716877Ssos    "sparc:v8plus",
7816877Ssos    3,
7916877Ssos    false,
8016877Ssos    sparc_compatible,
8116877Ssos    bfd_default_scan,
8216877Ssos    &arch_info_struct[3],
8316877Ssos  },
8416877Ssos  {
8516877Ssos    32,	/* bits in a word */
8616877Ssos    32,	/* bits in an address */
8716877Ssos    8,	/* bits in a byte */
8816877Ssos    bfd_arch_sparc,
8916877Ssos    bfd_mach_sparc_v8plusa,
9016877Ssos    "sparc",
9116877Ssos    "sparc:v8plusa",
9216877Ssos    3,
9316877Ssos    false,
9416877Ssos    sparc_compatible,
9518194Ssos    bfd_default_scan,
9616877Ssos    &arch_info_struct[4],
9716877Ssos  },
9874119Sache  {
9916877Ssos    32,	/* bits in a word */
10016877Ssos    32,	/* bits in an address */
10116877Ssos    8,	/* bits in a byte */
10216877Ssos    bfd_arch_sparc,
10316877Ssos    bfd_mach_sparc_sparclite_le,
10416877Ssos    "sparc",
10516877Ssos    "sparc:sparclite_le",
10616877Ssos    3,
10716877Ssos    false,
10874119Sache    sparc_compatible,
10916877Ssos    bfd_default_scan,
11043334Syokota    &arch_info_struct[5],
11143334Syokota  },
11243334Syokota  {
11343334Syokota    64,	/* bits in a word */
11443334Syokota    64,	/* bits in an address */
115    8,	/* bits in a byte */
116    bfd_arch_sparc,
117    bfd_mach_sparc_v9,
118    "sparc",
119    "sparc:v9",
120    3,
121    false,
122    sparc_compatible,
123    bfd_default_scan,
124    &arch_info_struct[6],
125  },
126  {
127    64,	/* bits in a word */
128    64,	/* bits in an address */
129    8,	/* bits in a byte */
130    bfd_arch_sparc,
131    bfd_mach_sparc_v9a,
132    "sparc",
133    "sparc:v9a",
134    3,
135    false,
136    sparc_compatible,
137    bfd_default_scan,
138    &arch_info_struct[7],
139  },
140  {
141    32,	/* bits in a word */
142    32,	/* bits in an address */
143    8,	/* bits in a byte */
144    bfd_arch_sparc,
145    bfd_mach_sparc_v8plusb,
146    "sparc",
147    "sparc:v8plusb",
148    3,
149    false,
150    sparc_compatible,
151    bfd_default_scan,
152    &arch_info_struct[8],
153  },
154  {
155    64,	/* bits in a word */
156    64,	/* bits in an address */
157    8,	/* bits in a byte */
158    bfd_arch_sparc,
159    bfd_mach_sparc_v9b,
160    "sparc",
161    "sparc:v9b",
162    3,
163    false,
164    sparc_compatible,
165    bfd_default_scan,
166    0,
167  }
168};
169
170const bfd_arch_info_type bfd_sparc_arch =
171  {
172    32,	/* bits in a word */
173    32,	/* bits in an address */
174    8,	/* bits in a byte */
175    bfd_arch_sparc,
176    bfd_mach_sparc,
177    "sparc",
178    "sparc",
179    3,
180    true, /* the default */
181    sparc_compatible,
182    bfd_default_scan,
183    &arch_info_struct[0],
184  };
185