cpu-m32c.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* BFD support for the M16C/M32C processors.
  2. Copyright (C) 2004-2022 Free Software Foundation, Inc.
  3. This file is part of BFD, the Binary File Descriptor library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #include "sysdep.h"
  17. #include "bfd.h"
  18. #include "libbfd.h"
  19. /* Like bfd_default_scan but if the string is just "m32c" then
  20. skip the m16c architecture. */
  21. static bool
  22. m32c_scan (const bfd_arch_info_type * info, const char * string)
  23. {
  24. if (strcmp (string, "m32c") == 0
  25. && info->mach == bfd_mach_m16c)
  26. return false;
  27. return bfd_default_scan (info, string);
  28. }
  29. #define N(number, print, align, default, next) \
  30. { 32, 32, 8, bfd_arch_m32c, number, "m32c", print, align, default, \
  31. bfd_default_compatible, m32c_scan, bfd_arch_default_fill, next, 0 }
  32. static const bfd_arch_info_type arch_info_struct =
  33. N (bfd_mach_m32c, "m32c", 3, false, NULL);
  34. const bfd_arch_info_type bfd_m32c_arch =
  35. N (bfd_mach_m16c, "m16c", 4, true, &arch_info_struct);