| 1 | /* BFD support for the SPARC architecture. | 
|---|
| 2 | Copyright 1992, 1995, 1996, 1998, 2000 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 | &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 |  | 
|---|
| 170 | const 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 | }; | 
|---|