cpu-s390.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* BFD support for the s390 processor.
  2. Copyright (C) 2000-2022 Free Software Foundation, Inc.
  3. Contributed by Carl B. Pedersen and Martin Schwidefsky.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  16. 02110-1301, USA. */
  17. #include "sysdep.h"
  18. #include "bfd.h"
  19. #include "libbfd.h"
  20. #define N(bits, number, print, is_default, next) \
  21. { \
  22. bits, /* Bits in a word. */ \
  23. bits, /* Bits in an address. */ \
  24. 8, /* Bits in a byte. */ \
  25. bfd_arch_s390, \
  26. number, \
  27. "s390", \
  28. print, \
  29. 3, /* Section alignment power */ \
  30. is_default, \
  31. bfd_default_compatible, \
  32. bfd_default_scan, \
  33. bfd_arch_default_fill, \
  34. next, \
  35. 0 /* Maximum offset of a reloc from the start of an insn. */ \
  36. }
  37. #if BFD_DEFAULT_TARGET_SIZE == 64
  38. static const bfd_arch_info_type bfd_s390_31_arch =
  39. N (32, bfd_mach_s390_31, "s390:31-bit", false, NULL);
  40. const bfd_arch_info_type bfd_s390_arch =
  41. N (64, bfd_mach_s390_64, "s390:64-bit", true, &bfd_s390_31_arch);
  42. #else
  43. static const bfd_arch_info_type bfd_s390_64_arch =
  44. N (64, bfd_mach_s390_64, "s390:64-bit", false, NULL);
  45. const bfd_arch_info_type bfd_s390_arch =
  46. N (32, bfd_mach_s390_31, "s390:31-bit", true, &bfd_s390_64_arch);
  47. #endif