frv.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* FRV ELF support for BFD.
  2. Copyright (C) 2002-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 Foundation,
  14. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  15. #ifndef _ELF_FRV_H
  16. #define _ELF_FRV_H
  17. #include "elf/reloc-macros.h"
  18. /* Relocations. */
  19. START_RELOC_NUMBERS (elf_frv_reloc_type)
  20. RELOC_NUMBER (R_FRV_NONE, 0)
  21. RELOC_NUMBER (R_FRV_32, 1)
  22. RELOC_NUMBER (R_FRV_LABEL16, 2)
  23. RELOC_NUMBER (R_FRV_LABEL24, 3)
  24. RELOC_NUMBER (R_FRV_LO16, 4)
  25. RELOC_NUMBER (R_FRV_HI16, 5)
  26. RELOC_NUMBER (R_FRV_GPREL12, 6)
  27. RELOC_NUMBER (R_FRV_GPRELU12, 7)
  28. RELOC_NUMBER (R_FRV_GPREL32, 8)
  29. RELOC_NUMBER (R_FRV_GPRELHI, 9)
  30. RELOC_NUMBER (R_FRV_GPRELLO, 10)
  31. RELOC_NUMBER (R_FRV_GOT12, 11)
  32. RELOC_NUMBER (R_FRV_GOTHI, 12)
  33. RELOC_NUMBER (R_FRV_GOTLO, 13)
  34. RELOC_NUMBER (R_FRV_FUNCDESC, 14)
  35. RELOC_NUMBER (R_FRV_FUNCDESC_GOT12, 15)
  36. RELOC_NUMBER (R_FRV_FUNCDESC_GOTHI, 16)
  37. RELOC_NUMBER (R_FRV_FUNCDESC_GOTLO, 17)
  38. RELOC_NUMBER (R_FRV_FUNCDESC_VALUE, 18)
  39. RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFF12, 19)
  40. RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFFHI, 20)
  41. RELOC_NUMBER (R_FRV_FUNCDESC_GOTOFFLO, 21)
  42. RELOC_NUMBER (R_FRV_GOTOFF12, 22)
  43. RELOC_NUMBER (R_FRV_GOTOFFHI, 23)
  44. RELOC_NUMBER (R_FRV_GOTOFFLO, 24)
  45. RELOC_NUMBER (R_FRV_GETTLSOFF, 25)
  46. RELOC_NUMBER (R_FRV_TLSDESC_VALUE, 26)
  47. RELOC_NUMBER (R_FRV_GOTTLSDESC12, 27)
  48. RELOC_NUMBER (R_FRV_GOTTLSDESCHI, 28)
  49. RELOC_NUMBER (R_FRV_GOTTLSDESCLO, 29)
  50. RELOC_NUMBER (R_FRV_TLSMOFF12, 30)
  51. RELOC_NUMBER (R_FRV_TLSMOFFHI, 31)
  52. RELOC_NUMBER (R_FRV_TLSMOFFLO, 32)
  53. RELOC_NUMBER (R_FRV_GOTTLSOFF12, 33)
  54. RELOC_NUMBER (R_FRV_GOTTLSOFFHI, 34)
  55. RELOC_NUMBER (R_FRV_GOTTLSOFFLO, 35)
  56. RELOC_NUMBER (R_FRV_TLSOFF, 36)
  57. RELOC_NUMBER (R_FRV_TLSDESC_RELAX, 37)
  58. RELOC_NUMBER (R_FRV_GETTLSOFF_RELAX, 38)
  59. RELOC_NUMBER (R_FRV_TLSOFF_RELAX, 39)
  60. RELOC_NUMBER (R_FRV_TLSMOFF, 40)
  61. RELOC_NUMBER (R_FRV_GNU_VTINHERIT, 200)
  62. RELOC_NUMBER (R_FRV_GNU_VTENTRY, 201)
  63. END_RELOC_NUMBERS(R_FRV_max)
  64. /* Processor specific flags for the ELF header e_flags field. */
  65. /* gpr support */
  66. #define EF_FRV_GPR_MASK 0x00000003 /* mask for # of gprs */
  67. #define EF_FRV_GPR_32 0x00000001 /* -mgpr-32 */
  68. #define EF_FRV_GPR_64 0x00000002 /* -mgpr-64 */
  69. /* fpr support */
  70. #define EF_FRV_FPR_MASK 0x0000000c /* mask for # of fprs */
  71. #define EF_FRV_FPR_32 0x00000004 /* -mfpr-32 */
  72. #define EF_FRV_FPR_64 0x00000008 /* -mfpr-64 */
  73. #define EF_FRV_FPR_NONE 0x0000000c /* -msoft-float */
  74. /* double word support */
  75. #define EF_FRV_DWORD_MASK 0x00000030 /* mask for dword support */
  76. #define EF_FRV_DWORD_YES 0x00000010 /* use double word insns */
  77. #define EF_FRV_DWORD_NO 0x00000020 /* don't use double word insn*/
  78. #define EF_FRV_DOUBLE 0x00000040 /* -mdouble */
  79. #define EF_FRV_MEDIA 0x00000080 /* -mmedia */
  80. #define EF_FRV_PIC 0x00000100 /* -fpic */
  81. #define EF_FRV_NON_PIC_RELOCS 0x00000200 /* used non pic safe relocs */
  82. #define EF_FRV_MULADD 0x00000400 /* -mmuladd */
  83. #define EF_FRV_BIGPIC 0x00000800 /* -fPIC */
  84. #define EF_FRV_LIBPIC 0x00001000 /* -mlibrary-pic */
  85. #define EF_FRV_G0 0x00002000 /* -G 0, no small data ptr */
  86. #define EF_FRV_NOPACK 0x00004000 /* -mnopack */
  87. #define EF_FRV_FDPIC 0x00008000 /* -mfdpic */
  88. #define EF_FRV_CPU_MASK 0xff000000 /* specific cpu bits */
  89. #define EF_FRV_CPU_GENERIC 0x00000000 /* generic FRV */
  90. #define EF_FRV_CPU_FR500 0x01000000 /* FRV500 */
  91. #define EF_FRV_CPU_FR300 0x02000000 /* FRV300 */
  92. #define EF_FRV_CPU_SIMPLE 0x03000000 /* SIMPLE */
  93. #define EF_FRV_CPU_TOMCAT 0x04000000 /* Tomcat, FR500 prototype */
  94. #define EF_FRV_CPU_FR400 0x05000000 /* FRV400 */
  95. #define EF_FRV_CPU_FR550 0x06000000 /* FRV550 */
  96. #define EF_FRV_CPU_FR405 0x07000000
  97. #define EF_FRV_CPU_FR450 0x08000000
  98. /* Mask of PIC related bits */
  99. #define EF_FRV_PIC_FLAGS (EF_FRV_PIC | EF_FRV_LIBPIC | EF_FRV_BIGPIC \
  100. | EF_FRV_FDPIC)
  101. /* Mask of all flags */
  102. #define EF_FRV_ALL_FLAGS (EF_FRV_GPR_MASK | \
  103. EF_FRV_FPR_MASK | \
  104. EF_FRV_DWORD_MASK | \
  105. EF_FRV_DOUBLE | \
  106. EF_FRV_MEDIA | \
  107. EF_FRV_PIC_FLAGS | \
  108. EF_FRV_NON_PIC_RELOCS | \
  109. EF_FRV_MULADD | \
  110. EF_FRV_G0 | \
  111. EF_FRV_NOPACK | \
  112. EF_FRV_CPU_MASK)
  113. #endif /* _ELF_FRV_H */