cpu-loongarch.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* BFD support for LoongArch.
  2. Copyright (C) 2021-2022 Free Software Foundation, Inc.
  3. Contributed by Loongson Ltd.
  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; see the file COPYING3. If not,
  15. see <http://www.gnu.org/licenses/>. */
  16. #include "sysdep.h"
  17. #include "bfd.h"
  18. #include "libbfd.h"
  19. static const bfd_arch_info_type bfd_loongarch32_arch =
  20. {
  21. 32, /* 32 bits in a word. */
  22. 32, /* 64 bits in an address. */
  23. 8, /* 8 bits in a byte. */
  24. bfd_arch_loongarch, /* Architecture. */
  25. bfd_mach_loongarch32, /* Machine number - 0 for now. */
  26. "loongarch32", /* Architecture name. */
  27. "Loongarch32", /* Printable name. */
  28. 3, /* Section align power. */
  29. false, /* This is the default architecture. */
  30. bfd_default_compatible, /* Architecture comparison function. */
  31. bfd_default_scan, /* String to architecture conversion. */
  32. bfd_arch_default_fill, /* Default fill. */
  33. NULL, /* Next in list. */
  34. 0,
  35. };
  36. const bfd_arch_info_type bfd_loongarch_arch =
  37. {
  38. 32, /* 32 bits in a word. */
  39. 64, /* 64 bits in an address. */
  40. 8, /* 8 bits in a byte. */
  41. bfd_arch_loongarch, /* Architecture. */
  42. /* Machine number of LoongArch64 is larger
  43. * so that LoongArch64 is compatible to LoongArch32. */
  44. bfd_mach_loongarch64,
  45. "loongarch64", /* Architecture name. */
  46. "Loongarch64", /* Printable name. */
  47. 3, /* Section align power. */
  48. true, /* This is the default architecture. */
  49. bfd_default_compatible, /* Architecture comparison function. */
  50. bfd_default_scan, /* String to architecture conversion. */
  51. bfd_arch_default_fill, /* Default fill. */
  52. &bfd_loongarch32_arch, /* Next in list. */
  53. 0,
  54. };