This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / bfd / cpu-sparc.c
1 /* BFD support for the SPARC architecture.
2    Copyright (C) 1992, 94, 95, 96, 1997 Free Software Foundation, Inc.
3
4 This file is part of BFD, the Binary File Descriptor library.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19
20 #include "bfd.h"
21 #include "sysdep.h"
22 #include "libbfd.h"
23
24 /* Don't mix 32 bit and 64 bit files.  */
25
26 static const bfd_arch_info_type *sparc_compatible
27   PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
28
29 static const bfd_arch_info_type *
30 sparc_compatible (a, b)
31      const bfd_arch_info_type *a;
32      const bfd_arch_info_type *b;
33 {
34   if (a->bits_per_word != b->bits_per_word)
35     return NULL;
36
37   return bfd_default_compatible (a, b);
38 }
39
40 static const bfd_arch_info_type arch_info_struct[] =
41 {
42   {
43     32, /* bits in a word */
44     32, /* bits in an address */
45     8,  /* bits in a byte */
46     bfd_arch_sparc,
47     bfd_mach_sparc_sparclet,
48     "sparc",
49     "sparc:sparclet",
50     3,
51     false,
52     sparc_compatible, 
53     bfd_default_scan,
54     &arch_info_struct[1],
55   },
56   {
57     32, /* bits in a word */
58     32, /* bits in an address */
59     8,  /* bits in a byte */
60     bfd_arch_sparc,
61     bfd_mach_sparc_sparclite,
62     "sparc",
63     "sparc:sparclite",
64     3,
65     false,
66     sparc_compatible, 
67     bfd_default_scan,
68     &arch_info_struct[2],
69   },
70   {
71     32, /* bits in a word */
72     32, /* bits in an address */
73     8,  /* bits in a byte */
74     bfd_arch_sparc,
75     bfd_mach_sparc_v8plus,
76     "sparc",
77     "sparc:v8plus",
78     3,
79     false,
80     sparc_compatible, 
81     bfd_default_scan,
82     &arch_info_struct[3],
83   },
84   {
85     32, /* bits in a word */
86     32, /* bits in an address */
87     8,  /* bits in a byte */
88     bfd_arch_sparc,
89     bfd_mach_sparc_v8plusa,
90     "sparc",
91     "sparc:v8plusa",
92     3,
93     false,
94     sparc_compatible, 
95     bfd_default_scan,
96     &arch_info_struct[4],
97   },
98   {
99     32, /* bits in a word */
100     32, /* bits in an address */
101     8,  /* bits in a byte */
102     bfd_arch_sparc,
103     bfd_mach_sparc_sparclite_le,
104     "sparc",
105     "sparc:sparclite_le",
106     3,
107     false,
108     sparc_compatible, 
109     bfd_default_scan,
110     &arch_info_struct[5],
111   },
112   {
113     64, /* bits in a word */
114     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     0,
139   }
140 };
141
142 const bfd_arch_info_type bfd_sparc_arch =
143   {
144     32, /* bits in a word */
145     32, /* bits in an address */
146     8,  /* bits in a byte */
147     bfd_arch_sparc,
148     bfd_mach_sparc,
149     "sparc",
150     "sparc",
151     3,
152     true, /* the default */
153     sparc_compatible, 
154     bfd_default_scan,
155     &arch_info_struct[0],
156   };