score.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Score ELF support for BFD.
  2. Copyright (C) 2006-2015 Free Software Foundation, Inc.
  3. Contributed by
  4. Brain.lin (brain.lin@sunplusct.com)
  5. Mei Ligang (ligang@sunnorth.com.cn)
  6. Pei-Lin Tsai (pltsai@sunplus.com)
  7. This file is part of BFD, the Binary File Descriptor library.
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 3 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation Inc., 51 Franklin Street - Fifth Floor, Boston,
  19. MA 02110-1301, USA. */
  20. #ifndef _ELF_SCORE_H
  21. #define _ELF_SCORE_H
  22. #include "elf/reloc-macros.h"
  23. #define SCORE_SIMULATOR_ACTIVE 1
  24. #define OPC_PTMASK 0xc0000000 /* Parity-bit Mask. */
  25. #define OPC16_PTMASK 0x00008000
  26. /* The parity-bit denotes. */
  27. #define OPC_32 0xc0000000 /* Denotes 32b instruction, (default). */
  28. #define OPC_16 0x00000000 /* Denotes 16b instruction. */
  29. #define OPC_PE 0x8000 /* Denotes parallel-execution instructions. */
  30. #define GP_DISP_LABEL "_gp_disp"
  31. /* Processor specific flags for the ELF header e_flags field: */
  32. #define EF_SCORE_MACH 0xffff0000
  33. #define EF_OMIT_PIC_FIXDD 0x0fff0000
  34. #define E_SCORE_MACH_SCORE3 0x00030000
  35. #define E_SCORE_MACH_SCORE7 0x00070000
  36. /* File contains position independent code. */
  37. #define EF_SCORE_PIC 0x80000000
  38. /* Fix data dependency. */
  39. #define EF_SCORE_FIXDEP 0x40000000
  40. /* Defined and allocated common symbol. Value is virtual address. If
  41. relocated, alignment must be preserved. */
  42. #define SHN_SCORE_TEXT (SHN_LORESERVE + 1)
  43. #define SHN_SCORE_DATA (SHN_LORESERVE + 2)
  44. /* Small common symbol. */
  45. #define SHN_SCORE_SCOMMON (SHN_LORESERVE + 3)
  46. /* Processor specific section flags. */
  47. /* This section must be in the global data area. */
  48. #define SHF_SCORE_GPREL 0x10000000
  49. /* This section should be merged. */
  50. #define SHF_SCORE_MERGE 0x20000000
  51. /* This section contains address data of size implied by section
  52. element size. */
  53. #define SHF_SCORE_ADDR 0x40000000
  54. /* This section contains string data. */
  55. #define SHF_SCORE_STRING 0x80000000
  56. /* This section may not be stripped. */
  57. #define SHF_SCORE_NOSTRIP 0x08000000
  58. /* This section is local to threads. */
  59. #define SHF_SCORE_LOCAL 0x04000000
  60. /* Linker should generate implicit weak names for this section. */
  61. #define SHF_SCORE_NAMES 0x02000000
  62. /* Section contais text/data which may be replicated in other sections.
  63. Linker should retain only one copy. */
  64. #define SHF_SCORE_NODUPES 0x01000000
  65. /* Processor specific dynamic array tags. */
  66. /* Base address of the segment. */
  67. #define DT_SCORE_BASE_ADDRESS 0x70000001
  68. /* Number of local global offset table entries. */
  69. #define DT_SCORE_LOCAL_GOTNO 0x70000002
  70. /* Number of entries in the .dynsym section. */
  71. #define DT_SCORE_SYMTABNO 0x70000003
  72. /* Index of first dynamic symbol in global offset table. */
  73. #define DT_SCORE_GOTSYM 0x70000004
  74. /* Index of first external dynamic symbol not referenced locally. */
  75. #define DT_SCORE_UNREFEXTNO 0x70000005
  76. /* Number of page table entries in global offset table. */
  77. #define DT_SCORE_HIPAGENO 0x70000006
  78. /* Processor specific section types. */
  79. /* Relocation types. */
  80. START_RELOC_NUMBERS (elf_score_reloc_type)
  81. RELOC_NUMBER (R_SCORE_NONE, 0)
  82. RELOC_NUMBER (R_SCORE_HI16, 1)
  83. RELOC_NUMBER (R_SCORE_LO16, 2)
  84. RELOC_NUMBER (R_SCORE_BCMP, 3)
  85. RELOC_NUMBER (R_SCORE_24, 4)
  86. RELOC_NUMBER (R_SCORE_PC19, 5)
  87. RELOC_NUMBER (R_SCORE16_11, 6)
  88. RELOC_NUMBER (R_SCORE16_PC8, 7)
  89. RELOC_NUMBER (R_SCORE_ABS32, 8)
  90. RELOC_NUMBER (R_SCORE_ABS16, 9)
  91. RELOC_NUMBER (R_SCORE_DUMMY2, 10)
  92. RELOC_NUMBER (R_SCORE_GP15, 11)
  93. RELOC_NUMBER (R_SCORE_GNU_VTINHERIT, 12)
  94. RELOC_NUMBER (R_SCORE_GNU_VTENTRY, 13)
  95. RELOC_NUMBER (R_SCORE_GOT15, 14)
  96. RELOC_NUMBER (R_SCORE_GOT_LO16, 15)
  97. RELOC_NUMBER (R_SCORE_CALL15, 16)
  98. RELOC_NUMBER (R_SCORE_GPREL32, 17)
  99. RELOC_NUMBER (R_SCORE_REL32, 18)
  100. RELOC_NUMBER (R_SCORE_DUMMY_HI16, 19)
  101. RELOC_NUMBER (R_SCORE_IMM30, 20)
  102. RELOC_NUMBER (R_SCORE_IMM32, 21)
  103. END_RELOC_NUMBERS (R_SCORE_max)
  104. #endif /* _ELF_SCORE_H */