cpu-nds32.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* BFD support for the NDS32 processor
  2. Copyright (C) 2012-2022 Free Software Foundation, Inc.
  3. Contributed by Andes Technology Corporation.
  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. #include "elf-bfd.h"
  21. #define N(number, print, default, next) \
  22. {32, 32, 8, bfd_arch_nds32, number, "nds32", print, 4, default, \
  23. bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 }
  24. #define NEXT &arch_info_struct[0]
  25. #define NDS32V2_NEXT &arch_info_struct[1]
  26. #define NDS32V3_NEXT &arch_info_struct[2]
  27. #define NDS32V3M_NEXT &arch_info_struct[3]
  28. static const bfd_arch_info_type arch_info_struct[] =
  29. {
  30. N (bfd_mach_n1h, "n1h", false, NDS32V2_NEXT),
  31. N (bfd_mach_n1h_v2, "n1h_v2", false, NDS32V3_NEXT),
  32. N (bfd_mach_n1h_v3, "n1h_v3", false, NDS32V3M_NEXT),
  33. N (bfd_mach_n1h_v3m, "n1h_v3m", false, NULL),
  34. };
  35. const bfd_arch_info_type bfd_nds32_arch =
  36. N (bfd_mach_n1, "n1", true, NEXT);