xref: /netbsd-src/external/gpl3/binutils/dist/bfd/cpu-sparc.c (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
12a6b7db3Sskrll /* BFD support for the SPARC architecture.
2*cb63e24eSchristos    Copyright (C) 1992-2024 Free Software Foundation, Inc.
32a6b7db3Sskrll 
42a6b7db3Sskrll    This file is part of BFD, the Binary File Descriptor library.
52a6b7db3Sskrll 
62a6b7db3Sskrll    This program is free software; you can redistribute it and/or modify
72a6b7db3Sskrll    it under the terms of the GNU General Public License as published by
82a6b7db3Sskrll    the Free Software Foundation; either version 3 of the License, or
92a6b7db3Sskrll    (at your option) any later version.
102a6b7db3Sskrll 
112a6b7db3Sskrll    This program is distributed in the hope that it will be useful,
122a6b7db3Sskrll    but WITHOUT ANY WARRANTY; without even the implied warranty of
132a6b7db3Sskrll    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142a6b7db3Sskrll    GNU General Public License for more details.
152a6b7db3Sskrll 
162a6b7db3Sskrll    You should have received a copy of the GNU General Public License
172a6b7db3Sskrll    along with this program; if not, write to the Free Software
182a6b7db3Sskrll    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
192a6b7db3Sskrll    MA 02110-1301, USA.  */
202a6b7db3Sskrll 
212a6b7db3Sskrll #include "sysdep.h"
222a6b7db3Sskrll #include "bfd.h"
232a6b7db3Sskrll #include "libbfd.h"
242a6b7db3Sskrll 
256f4ced0bSchristos #define N(BITS, NUMBER, PRINT, DEFAULT, NEXT) \
266f4ced0bSchristos   {							\
276f4ced0bSchristos     BITS,      /* Bits in a word.  */			\
286f4ced0bSchristos     BITS,      /* Bits in an address.  */		\
296f4ced0bSchristos     8,	       /* Bits in a byte.  */			\
306f4ced0bSchristos     bfd_arch_sparc,					\
316f4ced0bSchristos     NUMBER,						\
326f4ced0bSchristos     "sparc",						\
336f4ced0bSchristos     PRINT,						\
346f4ced0bSchristos     3,		/* Section alignment power.  */		\
356f4ced0bSchristos     DEFAULT,						\
366f4ced0bSchristos     bfd_default_compatible,				\
376f4ced0bSchristos     bfd_default_scan,					\
386f4ced0bSchristos     bfd_arch_default_fill,				\
396f4ced0bSchristos     NEXT,						\
406f4ced0bSchristos     0 /* Maximum offset of a reloc from the start of an insn.  */ \
416f4ced0bSchristos   }
426f4ced0bSchristos 
432a6b7db3Sskrll static const bfd_arch_info_type arch_info_struct[] =
442a6b7db3Sskrll {
454f645668Schristos   N (32, bfd_mach_sparc_sparclet,     "sparc:sparclet",     false, arch_info_struct + 1),
464f645668Schristos   N (32, bfd_mach_sparc_sparclite,    "sparc:sparclite",    false, arch_info_struct + 2),
474f645668Schristos   N (32, bfd_mach_sparc_v8plus,       "sparc:v8plus",       false, arch_info_struct + 3),
484f645668Schristos   N (32, bfd_mach_sparc_v8plusa,      "sparc:v8plusa",      false, arch_info_struct + 4),
494f645668Schristos   N (32, bfd_mach_sparc_sparclite_le, "sparc:sparclite_le", false, arch_info_struct + 5),
504f645668Schristos   N (64, bfd_mach_sparc_v9,           "sparc:v9",           false, arch_info_struct + 6),
514f645668Schristos   N (64, bfd_mach_sparc_v9a,          "sparc:v9a",          false, arch_info_struct + 7),
524f645668Schristos   N (32, bfd_mach_sparc_v8plusb,      "sparc:v8plusb",      false, arch_info_struct + 8),
534f645668Schristos   N (64, bfd_mach_sparc_v9b,          "sparc:v9b",          false, arch_info_struct + 9),
544f645668Schristos   N (32, bfd_mach_sparc_v8plusc,      "sparc:v8plusc",      false, arch_info_struct + 10),
554f645668Schristos   N (64, bfd_mach_sparc_v9c,          "sparc:v9c",          false, arch_info_struct + 11),
564f645668Schristos   N (32, bfd_mach_sparc_v8plusd,      "sparc:v8plusd",      false, arch_info_struct + 12),
574f645668Schristos   N (64, bfd_mach_sparc_v9d,          "sparc:v9d",          false, arch_info_struct + 13),
584f645668Schristos   N (32, bfd_mach_sparc_v8pluse,      "sparc:v8pluse",      false, arch_info_struct + 14),
594f645668Schristos   N (64, bfd_mach_sparc_v9e,          "sparc:v9e",          false, arch_info_struct + 15),
604f645668Schristos   N (32, bfd_mach_sparc_v8plusv,      "sparc:v8plusv",      false, arch_info_struct + 16),
614f645668Schristos   N (64, bfd_mach_sparc_v9v,          "sparc:v9v",          false, arch_info_struct + 17),
624f645668Schristos   N (32, bfd_mach_sparc_v8plusm,      "sparc:v8plusm",      false, arch_info_struct + 18),
634f645668Schristos   N (64, bfd_mach_sparc_v9m,          "sparc:v9m",          false, arch_info_struct + 19),
644f645668Schristos   N (32, bfd_mach_sparc_v8plusm8,     "sparc:v8plusm8",     false, arch_info_struct + 20),
654f645668Schristos   N (64, bfd_mach_sparc_v9m8,         "sparc:v9m8",         false, NULL)
662a6b7db3Sskrll };
672a6b7db3Sskrll 
682a6b7db3Sskrll const bfd_arch_info_type bfd_sparc_arch =
694f645668Schristos   N (32, bfd_mach_sparc, "sparc", true, arch_info_struct);
70