xref: /netbsd-src/external/gpl3/binutils.old/dist/bfd/cpu-s390.c (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* BFD support for the s390 processor.
2*e992f068Schristos    Copyright (C) 2000-2022 Free Software Foundation, Inc.
375fd0b74Schristos    Contributed by Carl B. Pedersen and Martin Schwidefsky.
475fd0b74Schristos 
575fd0b74Schristos    This file is part of BFD, the Binary File Descriptor library.
675fd0b74Schristos 
775fd0b74Schristos    This program is free software; you can redistribute it and/or modify
875fd0b74Schristos    it under the terms of the GNU General Public License as published by
975fd0b74Schristos    the Free Software Foundation; either version 3 of the License, or
1075fd0b74Schristos    (at your option) any later version.
1175fd0b74Schristos 
1275fd0b74Schristos    This program is distributed in the hope that it will be useful,
1375fd0b74Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1475fd0b74Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1575fd0b74Schristos    GNU General Public License for more details.
1675fd0b74Schristos 
1775fd0b74Schristos    You should have received a copy of the GNU General Public License
1875fd0b74Schristos    along with this program; if not, write to the Free Software
1975fd0b74Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2075fd0b74Schristos    02110-1301, USA.  */
2175fd0b74Schristos 
2275fd0b74Schristos #include "sysdep.h"
2375fd0b74Schristos #include "bfd.h"
2475fd0b74Schristos #include "libbfd.h"
2575fd0b74Schristos 
2675fd0b74Schristos #define N(bits, number, print, is_default, next)	\
2775fd0b74Schristos   {							\
28012573ebSchristos     bits,	       /* Bits in a word.  */		\
29012573ebSchristos     bits,	       /* Bits in an address.  */	\
30012573ebSchristos     8,		       /* Bits in a byte.  */		\
3175fd0b74Schristos     bfd_arch_s390,					\
3275fd0b74Schristos     number,						\
3375fd0b74Schristos     "s390",						\
3475fd0b74Schristos     print,						\
35012573ebSchristos     3,		       /* Section alignment power */	\
3675fd0b74Schristos     is_default,						\
3775fd0b74Schristos     bfd_default_compatible,				\
3875fd0b74Schristos     bfd_default_scan,					\
3975fd0b74Schristos     bfd_arch_default_fill,				\
40012573ebSchristos     next,						\
41012573ebSchristos     0 /* Maximum offset of a reloc from the start of an insn.  */ \
4275fd0b74Schristos   }
4375fd0b74Schristos 
4475fd0b74Schristos #if BFD_DEFAULT_TARGET_SIZE == 64
4575fd0b74Schristos static const bfd_arch_info_type bfd_s390_31_arch =
46*e992f068Schristos   N (32, bfd_mach_s390_31, "s390:31-bit", false, NULL);
4775fd0b74Schristos const bfd_arch_info_type bfd_s390_arch =
48*e992f068Schristos   N (64, bfd_mach_s390_64, "s390:64-bit", true, &bfd_s390_31_arch);
4975fd0b74Schristos #else
5075fd0b74Schristos static const bfd_arch_info_type bfd_s390_64_arch =
51*e992f068Schristos   N (64, bfd_mach_s390_64, "s390:64-bit", false, NULL);
5275fd0b74Schristos const bfd_arch_info_type bfd_s390_arch =
53*e992f068Schristos   N (32, bfd_mach_s390_31, "s390:31-bit", true, &bfd_s390_64_arch);
5475fd0b74Schristos #endif
55