nios2.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* Altera Nios II ELF support for BFD.
  2. Copyright (C) 2012-2015 Free Software Foundation, Inc.
  3. Contributed by Nigel Gray (ngray@altera.com).
  4. Contributed by Mentor Graphics, Inc.
  5. This file is part of BFD, the Binary File Descriptor library.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  17. MA 02110-1301, USA. */
  18. /* This file holds definitions specific to the Altera Nios II ELF ABI. Note
  19. that most of this is not actually implemented by BFD. */
  20. #ifndef _ELF_NIOS2_H
  21. #define _ELF_NIOS2_H
  22. #include "elf/reloc-macros.h"
  23. /* The order of these numbers must match the order in
  24. the elf_nios2_howto_table_rel table for the lookup
  25. function to work properly. */
  26. START_RELOC_NUMBERS (elf_nios2_reloc_type)
  27. /* Relocs used by both R1 and R2, with different howtos to match
  28. the respective encodings. */
  29. RELOC_NUMBER (R_NIOS2_NONE, 0)
  30. RELOC_NUMBER (R_NIOS2_S16, 1)
  31. RELOC_NUMBER (R_NIOS2_U16, 2)
  32. RELOC_NUMBER (R_NIOS2_PCREL16, 3)
  33. RELOC_NUMBER (R_NIOS2_CALL26, 4)
  34. RELOC_NUMBER (R_NIOS2_IMM5, 5)
  35. RELOC_NUMBER (R_NIOS2_CACHE_OPX, 6)
  36. RELOC_NUMBER (R_NIOS2_IMM6, 7)
  37. RELOC_NUMBER (R_NIOS2_IMM8, 8)
  38. RELOC_NUMBER (R_NIOS2_HI16, 9)
  39. RELOC_NUMBER (R_NIOS2_LO16, 10)
  40. RELOC_NUMBER (R_NIOS2_HIADJ16, 11)
  41. RELOC_NUMBER (R_NIOS2_BFD_RELOC_32, 12)
  42. RELOC_NUMBER (R_NIOS2_BFD_RELOC_16, 13)
  43. RELOC_NUMBER (R_NIOS2_BFD_RELOC_8, 14)
  44. RELOC_NUMBER (R_NIOS2_GPREL, 15)
  45. RELOC_NUMBER (R_NIOS2_GNU_VTINHERIT, 16)
  46. RELOC_NUMBER (R_NIOS2_GNU_VTENTRY, 17)
  47. RELOC_NUMBER (R_NIOS2_UJMP, 18)
  48. RELOC_NUMBER (R_NIOS2_CJMP, 19)
  49. RELOC_NUMBER (R_NIOS2_CALLR, 20)
  50. RELOC_NUMBER (R_NIOS2_ALIGN, 21)
  51. RELOC_NUMBER (R_NIOS2_GOT16, 22)
  52. RELOC_NUMBER (R_NIOS2_CALL16, 23)
  53. RELOC_NUMBER (R_NIOS2_GOTOFF_LO, 24)
  54. RELOC_NUMBER (R_NIOS2_GOTOFF_HA, 25)
  55. RELOC_NUMBER (R_NIOS2_PCREL_LO, 26)
  56. RELOC_NUMBER (R_NIOS2_PCREL_HA, 27)
  57. RELOC_NUMBER (R_NIOS2_TLS_GD16, 28)
  58. RELOC_NUMBER (R_NIOS2_TLS_LDM16, 29)
  59. RELOC_NUMBER (R_NIOS2_TLS_LDO16, 30)
  60. RELOC_NUMBER (R_NIOS2_TLS_IE16, 31)
  61. RELOC_NUMBER (R_NIOS2_TLS_LE16, 32)
  62. RELOC_NUMBER (R_NIOS2_TLS_DTPMOD, 33)
  63. RELOC_NUMBER (R_NIOS2_TLS_DTPREL, 34)
  64. RELOC_NUMBER (R_NIOS2_TLS_TPREL, 35)
  65. RELOC_NUMBER (R_NIOS2_COPY, 36)
  66. RELOC_NUMBER (R_NIOS2_GLOB_DAT, 37)
  67. RELOC_NUMBER (R_NIOS2_JUMP_SLOT, 38)
  68. RELOC_NUMBER (R_NIOS2_RELATIVE, 39)
  69. RELOC_NUMBER (R_NIOS2_GOTOFF, 40)
  70. RELOC_NUMBER (R_NIOS2_CALL26_NOAT, 41)
  71. RELOC_NUMBER (R_NIOS2_GOT_LO, 42)
  72. RELOC_NUMBER (R_NIOS2_GOT_HA, 43)
  73. RELOC_NUMBER (R_NIOS2_CALL_LO, 44)
  74. RELOC_NUMBER (R_NIOS2_CALL_HA, 45)
  75. /* Relocs specific to R2. */
  76. RELOC_NUMBER (R_NIOS2_R2_S12, 64)
  77. RELOC_NUMBER (R_NIOS2_R2_I10_1_PCREL, 65)
  78. RELOC_NUMBER (R_NIOS2_R2_T1I7_1_PCREL, 66)
  79. RELOC_NUMBER (R_NIOS2_R2_T1I7_2, 67)
  80. RELOC_NUMBER (R_NIOS2_R2_T2I4, 68)
  81. RELOC_NUMBER (R_NIOS2_R2_T2I4_1, 69)
  82. RELOC_NUMBER (R_NIOS2_R2_T2I4_2, 70)
  83. RELOC_NUMBER (R_NIOS2_R2_X1I7_2, 71)
  84. RELOC_NUMBER (R_NIOS2_R2_X2L5, 72)
  85. RELOC_NUMBER (R_NIOS2_R2_F1I5_2, 73)
  86. RELOC_NUMBER (R_NIOS2_R2_L5I4X1, 74)
  87. RELOC_NUMBER (R_NIOS2_R2_T1X1I6, 75)
  88. RELOC_NUMBER (R_NIOS2_R2_T1X1I6_2, 76)
  89. /* Last reloc. */
  90. RELOC_NUMBER (R_NIOS2_ILLEGAL, 77)
  91. END_RELOC_NUMBERS (R_NIOS2_maxext)
  92. /* Processor-specific section flags. */
  93. /* This is used to mark gp-relative sections. */
  94. #define SHF_NIOS2_GPREL 0x10000000
  95. /* Processor-specific dynamic array tags. */
  96. /* Address of _gp. */
  97. #define DT_NIOS2_GP 0x70000002
  98. /* Processor specific flags for the Elf header e_flags field. */
  99. #define EF_NIOS2_ARCH_R1 0x00000000
  100. #define EF_NIOS2_ARCH_R2 0x00000001
  101. #endif /* _ELF_NIOS2_H */