csky.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /* C-SKY ELF support for BFD.
  2. Copyright (C) 1998-2022 Free Software Foundation, Inc.
  3. Contributed by C-SKY Microsystems and Mentor Graphics.
  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 Foundation,
  15. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  16. #ifndef _ELF_CSKY_H
  17. #define _ELF_CSKY_H
  18. #include "elf/reloc-macros.h"
  19. /* Values of relocation types according to the ABI doc.
  20. The order should be consistent with csky bfd reloc type
  21. table in bfd-in2.h. */
  22. START_RELOC_NUMBERS (elf_csky_reloc_type)
  23. RELOC_NUMBER (R_CKCORE_NONE,0)
  24. RELOC_NUMBER (R_CKCORE_ADDR32,1)
  25. RELOC_NUMBER (R_CKCORE_PCREL_IMM8BY4,2)
  26. RELOC_NUMBER (R_CKCORE_PCREL_IMM11BY2,3)
  27. RELOC_NUMBER (R_CKCORE_PCREL_IMM4BY2,4)
  28. RELOC_NUMBER (R_CKCORE_PCREL32,5)
  29. RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM11BY2,6)
  30. RELOC_NUMBER (R_CKCORE_GNU_VTINHERIT,7)
  31. RELOC_NUMBER (R_CKCORE_GNU_VTENTRY,8)
  32. RELOC_NUMBER (R_CKCORE_RELATIVE,9)
  33. RELOC_NUMBER (R_CKCORE_COPY,10)
  34. RELOC_NUMBER (R_CKCORE_GLOB_DAT,11)
  35. RELOC_NUMBER (R_CKCORE_JUMP_SLOT,12)
  36. RELOC_NUMBER (R_CKCORE_GOTOFF,13)
  37. RELOC_NUMBER (R_CKCORE_GOTPC,14)
  38. RELOC_NUMBER (R_CKCORE_GOT32,15)
  39. RELOC_NUMBER (R_CKCORE_PLT32,16)
  40. RELOC_NUMBER (R_CKCORE_ADDRGOT,17)
  41. RELOC_NUMBER (R_CKCORE_ADDRPLT,18)
  42. RELOC_NUMBER (R_CKCORE_PCREL_IMM26BY2,19)
  43. RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY2,20)
  44. RELOC_NUMBER (R_CKCORE_PCREL_IMM16BY4,21)
  45. RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY2,22)
  46. RELOC_NUMBER (R_CKCORE_PCREL_IMM10BY4,23)
  47. RELOC_NUMBER (R_CKCORE_ADDR_HI16,24)
  48. RELOC_NUMBER (R_CKCORE_ADDR_LO16,25)
  49. RELOC_NUMBER (R_CKCORE_GOTPC_HI16,26)
  50. RELOC_NUMBER (R_CKCORE_GOTPC_LO16,27)
  51. RELOC_NUMBER (R_CKCORE_GOTOFF_HI16,28)
  52. RELOC_NUMBER (R_CKCORE_GOTOFF_LO16,29)
  53. RELOC_NUMBER (R_CKCORE_GOT12,30)
  54. RELOC_NUMBER (R_CKCORE_GOT_HI16,31)
  55. RELOC_NUMBER (R_CKCORE_GOT_LO16,32)
  56. RELOC_NUMBER (R_CKCORE_PLT12,33)
  57. RELOC_NUMBER (R_CKCORE_PLT_HI16,34)
  58. RELOC_NUMBER (R_CKCORE_PLT_LO16,35)
  59. RELOC_NUMBER (R_CKCORE_ADDRGOT_HI16,36)
  60. RELOC_NUMBER (R_CKCORE_ADDRGOT_LO16,37)
  61. RELOC_NUMBER (R_CKCORE_ADDRPLT_HI16,38)
  62. RELOC_NUMBER (R_CKCORE_ADDRPLT_LO16,39)
  63. RELOC_NUMBER (R_CKCORE_PCREL_JSR_IMM26BY2,40)
  64. RELOC_NUMBER (R_CKCORE_TOFFSET_LO16, 41)
  65. RELOC_NUMBER (R_CKCORE_DOFFSET_LO16, 42)
  66. RELOC_NUMBER (R_CKCORE_PCREL_IMM18BY2, 43)
  67. RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18, 44)
  68. RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY2, 45)
  69. RELOC_NUMBER (R_CKCORE_DOFFSET_IMM18BY4, 46)
  70. RELOC_NUMBER (R_CKCORE_GOTOFF_IMM18, 47)
  71. RELOC_NUMBER (R_CKCORE_GOT_IMM18BY4, 48)
  72. RELOC_NUMBER (R_CKCORE_PLT_IMM18BY4, 49)
  73. RELOC_NUMBER (R_CKCORE_PCREL_IMM7BY4, 50)
  74. RELOC_NUMBER (R_CKCORE_TLS_LE32, 51)
  75. RELOC_NUMBER (R_CKCORE_TLS_IE32, 52)
  76. RELOC_NUMBER (R_CKCORE_TLS_GD32, 53)
  77. RELOC_NUMBER (R_CKCORE_TLS_LDM32, 54)
  78. RELOC_NUMBER (R_CKCORE_TLS_LDO32, 55)
  79. RELOC_NUMBER (R_CKCORE_TLS_DTPMOD32, 56)
  80. RELOC_NUMBER (R_CKCORE_TLS_DTPOFF32, 57)
  81. RELOC_NUMBER (R_CKCORE_TLS_TPOFF32, 58)
  82. RELOC_NUMBER (R_CKCORE_PCREL_FLRW_IMM8BY4, 59)
  83. RELOC_NUMBER (R_CKCORE_NOJSRI, 60)
  84. RELOC_NUMBER (R_CKCORE_CALLGRAPH, 61)
  85. RELOC_NUMBER (R_CKCORE_IRELATIVE, 62)
  86. RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM4BY4, 63)
  87. RELOC_NUMBER (R_CKCORE_PCREL_BLOOP_IMM12BY4, 64)
  88. END_RELOC_NUMBERS (R_CKCORE_MAX)
  89. /* Additional section types. */
  90. #define SHT_CSKY_ATTRIBUTES 0x70000001 /* Section holds attributes. */
  91. /* Object attribute tags. */
  92. enum
  93. {
  94. /* 0-3 are generic. */
  95. /* Arch name for this object file. */
  96. Tag_CSKY_ARCH_NAME = 4,
  97. Tag_CSKY_CPU_NAME = 5,
  98. /* ISA flags for this object file. */
  99. Tag_CSKY_ISA_FLAGS,
  100. Tag_CSKY_ISA_EXT_FLAGS,
  101. /* CSKY DSP version used by this object file. */
  102. Tag_CSKY_DSP_VERSION,
  103. /* CSKY VDSP version used by this object file. */
  104. Tag_CSKY_VDSP_VERSION,
  105. /* CSKY FPU version used by this object file. */
  106. Tag_CSKY_FPU_VERSION = 0x10,
  107. /* FPU ABI. params: Soft GR/Hard GR/Hard FR. */
  108. Tag_CSKY_FPU_ABI,
  109. /* Rounding Support. */
  110. Tag_CSKY_FPU_ROUNDING,
  111. /* Denormal Support. */
  112. Tag_CSKY_FPU_DENORMAL,
  113. /* Exeception Support. */
  114. Tag_CSKY_FPU_Exception,
  115. /* Number Module Support("IEEE 754"). */
  116. Tag_CSKY_FPU_NUMBER_MODULE,
  117. /* Half/Single/Double. */
  118. Tag_CSKY_FPU_HARDFP,
  119. Tag_CSKY_MAX,
  120. };
  121. /* Object attribute values. */
  122. enum
  123. {
  124. /* Values defined for Tag_CSKY_DSP_VERSION. */
  125. VAL_CSKY_DSP_VERSION_EXTENSION = 1, /* hi-lo DSP extension. */
  126. VAL_CSKY_DSP_VERSION_2 = 2, /* CK803s EDSP. */
  127. };
  128. enum
  129. {
  130. /* Values defined for Tag_CSKY_VDSP_VERSION. */
  131. VAL_CSKY_VDSP_VERSION_1 = 1, /* VDSP version 1. */
  132. VAL_CSKY_VDSP_VERSION_2 /* VDSP version 1. */
  133. };
  134. enum
  135. {
  136. /* Values defined for Tag_CSKY_FPU_VERSION. */
  137. VAL_CSKY_FPU_VERSION_1 = 1, /* ABIV1 FPU. */
  138. VAL_CSKY_FPU_VERSION_2, /* ABIV2 FPU. */
  139. };
  140. enum
  141. {
  142. VAL_CSKY_FPU_ABI_SOFT = 1,
  143. VAL_CSKY_FPU_ABI_SOFTFP,
  144. VAL_CSKY_FPU_ABI_HARD,
  145. };
  146. enum
  147. {
  148. VAL_CSKY_FPU_HARDFP_HALF = 1,
  149. VAL_CSKY_FPU_HARDFP_SINGLE = 2,
  150. VAL_CSKY_FPU_HARDFP_DOUBLE = 4,
  151. };
  152. #endif /* _ELF_CSKY_H */