2000-03-08 H.J. Lu (hjl@gnu.org)
[binutils.git] / bfd / cpu-sparc.c
blob234bd92bd29c1b9b2230e651aa09dc8049668097
1 /* BFD support for the SPARC architecture.
2 Copyright (C) 1992, 94, 95, 96, 1997 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
20 #include "bfd.h"
21 #include "sysdep.h"
22 #include "libbfd.h"
24 /* Don't mix 32 bit and 64 bit files. */
26 static const bfd_arch_info_type *sparc_compatible
27 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
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;
34 if (a->bits_per_word != b->bits_per_word)
35 return NULL;
37 return bfd_default_compatible (a, b);
40 static const bfd_arch_info_type arch_info_struct[] =
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",
51 false,
52 sparc_compatible,
53 bfd_default_scan,
54 &arch_info_struct[1],
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",
65 false,
66 sparc_compatible,
67 bfd_default_scan,
68 &arch_info_struct[2],
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",
79 false,
80 sparc_compatible,
81 bfd_default_scan,
82 &arch_info_struct[3],
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",
93 false,
94 sparc_compatible,
95 bfd_default_scan,
96 &arch_info_struct[4],
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",
107 false,
108 sparc_compatible,
109 bfd_default_scan,
110 &arch_info_struct[5],
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",
121 false,
122 sparc_compatible,
123 bfd_default_scan,
124 &arch_info_struct[6],
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",
135 false,
136 sparc_compatible,
137 bfd_default_scan,
142 const bfd_arch_info_type bfd_sparc_arch =
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",
152 true, /* the default */
153 sparc_compatible,
154 bfd_default_scan,
155 &arch_info_struct[0],