tic6x.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* TI C6X ELF support for BFD.
  2. Copyright (C) 2010-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. #ifndef _ELF_TIC6X_H
  17. #define _ELF_TIC6X_H
  18. #include "elf/reloc-macros.h"
  19. /* Relocation types. */
  20. START_RELOC_NUMBERS (elf_tic6x_reloc_type)
  21. RELOC_NUMBER (R_C6000_NONE, 0)
  22. RELOC_NUMBER (R_C6000_ABS32, 1)
  23. RELOC_NUMBER (R_C6000_ABS16, 2)
  24. RELOC_NUMBER (R_C6000_ABS8, 3)
  25. RELOC_NUMBER (R_C6000_PCR_S21, 4)
  26. RELOC_NUMBER (R_C6000_PCR_S12, 5)
  27. RELOC_NUMBER (R_C6000_PCR_S10, 6)
  28. RELOC_NUMBER (R_C6000_PCR_S7, 7)
  29. RELOC_NUMBER (R_C6000_ABS_S16, 8)
  30. RELOC_NUMBER (R_C6000_ABS_L16, 9)
  31. RELOC_NUMBER (R_C6000_ABS_H16, 10)
  32. RELOC_NUMBER (R_C6000_SBR_U15_B, 11)
  33. RELOC_NUMBER (R_C6000_SBR_U15_H, 12)
  34. RELOC_NUMBER (R_C6000_SBR_U15_W, 13)
  35. RELOC_NUMBER (R_C6000_SBR_S16, 14)
  36. RELOC_NUMBER (R_C6000_SBR_L16_B, 15)
  37. RELOC_NUMBER (R_C6000_SBR_L16_H, 16)
  38. RELOC_NUMBER (R_C6000_SBR_L16_W, 17)
  39. RELOC_NUMBER (R_C6000_SBR_H16_B, 18)
  40. RELOC_NUMBER (R_C6000_SBR_H16_H, 19)
  41. RELOC_NUMBER (R_C6000_SBR_H16_W, 20)
  42. RELOC_NUMBER (R_C6000_SBR_GOT_U15_W, 21)
  43. RELOC_NUMBER (R_C6000_SBR_GOT_L16_W, 22)
  44. RELOC_NUMBER (R_C6000_SBR_GOT_H16_W, 23)
  45. RELOC_NUMBER (R_C6000_DSBT_INDEX, 24)
  46. RELOC_NUMBER (R_C6000_PREL31, 25)
  47. RELOC_NUMBER (R_C6000_COPY, 26)
  48. RELOC_NUMBER (R_C6000_JUMP_SLOT, 27)
  49. RELOC_NUMBER (R_C6000_EHTYPE, 28)
  50. RELOC_NUMBER (R_C6000_PCR_H16, 29)
  51. RELOC_NUMBER (R_C6000_PCR_L16, 30)
  52. RELOC_NUMBER (R_C6000_ALIGN, 253)
  53. RELOC_NUMBER (R_C6000_FPHEAD, 254)
  54. RELOC_NUMBER (R_C6000_NOCMP, 255)
  55. END_RELOC_NUMBERS (R_TIC6X_max)
  56. /* Processor-specific flags. */
  57. /* File contains static relocation information. */
  58. #define EF_C6000_REL 0x1
  59. /* Processor-specific section types. */
  60. /* Unwind function table for stack unwinding. */
  61. #define SHT_C6000_UNWIND 0x70000001
  62. /* DLL dynamic linking pre-emption map. */
  63. #define SHT_C6000_PREEMPTMAP 0x70000002
  64. /* Object file compatibility attributes. */
  65. #define SHT_C6000_ATTRIBUTES 0x70000003
  66. /* Intermediate code for link-time optimization. */
  67. #define SHT_TI_ICODE 0x7F000000
  68. /* Symbolic cross reference information. */
  69. #define SHT_TI_XREF 0x7F000001
  70. /* Reserved. */
  71. #define SHT_TI_HANDLER 0x7F000002
  72. /* Compressed data for initializing C variables. */
  73. #define SHT_TI_INITINFO 0x7F000003
  74. /* Extended program header attributes. */
  75. #define SHT_TI_PHATTRS 0x7F000004
  76. /* Processor specific section indices. These sections do not actually
  77. exist. Symbols with a st_shndx field corresponding to one of these
  78. values have a special meaning. */
  79. /* Small data area common symbol. */
  80. #define SHN_TIC6X_SCOMMON SHN_LORESERVE
  81. /* Processor-specific segment types. */
  82. /* Extended Segment Attributes. */
  83. #define PT_C6000_PHATTR 0x70000000
  84. /* Processor-specific dynamic tags. */
  85. /* Undocumented. */
  86. #define DT_C6000_GSYM_OFFSET 0x6000000D
  87. /* Undocumented. */
  88. #define DT_C6000_GSTR_OFFSET 0x6000000F
  89. /* Statically linked base address of data segment. */
  90. #define DT_C6000_DSBT_BASE 0x70000000
  91. /* Number of entries in this module's DSBT. */
  92. #define DT_C6000_DSBT_SIZE 0x70000001
  93. /* Undocumented. */
  94. #define DT_C6000_PREEMPTMAP 0x70000002
  95. /* The hard-coded DSBT index for this module, if any. */
  96. #define DT_C6000_DSBT_INDEX 0x70000003
  97. /* Extended program header attributes. */
  98. /* Terminate a segment. */
  99. #define PHA_NULL 0x0
  100. /* Segment's address bound to the final address. */
  101. #define PHA_BOUND 0x1
  102. /* Segment cannot be further relocated. */
  103. #define PHA_READONLY 0x2
  104. /* Build attributes. */
  105. enum
  106. {
  107. #define TAG(tag, value) tag = value,
  108. #include "elf/tic6x-attrs.h"
  109. #undef TAG
  110. Tag_C6XABI_last
  111. };
  112. /* Values for Tag_ISA. GNU-specific names; the ABI does not specify
  113. names for these values. */
  114. enum
  115. {
  116. C6XABI_Tag_ISA_none = 0,
  117. C6XABI_Tag_ISA_C62X = 1,
  118. C6XABI_Tag_ISA_C67X = 3,
  119. C6XABI_Tag_ISA_C67XP = 4,
  120. C6XABI_Tag_ISA_C64X = 6,
  121. C6XABI_Tag_ISA_C64XP = 7,
  122. C6XABI_Tag_ISA_C674X = 8
  123. };
  124. /* Special section names. */
  125. #define ELF_STRING_C6000_unwind ".c6xabi.exidx"
  126. #define ELF_STRING_C6000_unwind_info ".c6xabi.extab"
  127. #define ELF_STRING_C6000_unwind_once ".gnu.linkonce.c6xabi.exidx."
  128. #define ELF_STRING_C6000_unwind_info_once ".gnu.linkonce.c6xabi.extab."
  129. #endif /* _ELF_TIC6X_H */