s390.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* 390 ELF support for BFD.
  2. Copyright (C) 2000-2022 Free Software Foundation, Inc.
  3. Contributed by Carl B. Pedersen and Martin Schwidefsky.
  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
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  16. 02110-1301, USA. */
  17. #ifndef _ELF_390_H
  18. #define _ELF_390_H
  19. /* Processor specific flags for the ELF header e_flags field. */
  20. /* Symbol types. */
  21. #define STACK_REG 15 /* Global Stack reg */
  22. #define BACKL_REG 14 /* Global Backlink reg */
  23. #define BASE_REG 13 /* Global Base reg */
  24. #define GOT_REG 12 /* Holds addr of GOT */
  25. #include "elf/reloc-macros.h"
  26. /* Processor specific flags for the ELF header e_flags field. */
  27. #define EF_S390_HIGH_GPRS 0x00000001
  28. /* Request 4k page table size. */
  29. #define PT_S390_PGSTE (PT_LOPROC + 0)
  30. /* Relocation types. */
  31. START_RELOC_NUMBERS (elf_s390_reloc_type)
  32. RELOC_NUMBER (R_390_NONE, 0) /* No reloc. */
  33. RELOC_NUMBER (R_390_8, 1) /* Direct 8 bit. */
  34. RELOC_NUMBER (R_390_12, 2) /* Direct 12 bit. */
  35. RELOC_NUMBER (R_390_16, 3) /* Direct 16 bit. */
  36. RELOC_NUMBER (R_390_32, 4) /* Direct 32 bit. */
  37. RELOC_NUMBER (R_390_PC32, 5) /* PC relative 32 bit. */
  38. RELOC_NUMBER (R_390_GOT12, 6) /* 12 bit GOT offset. */
  39. RELOC_NUMBER (R_390_GOT32, 7) /* 32 bit GOT offset. */
  40. RELOC_NUMBER (R_390_PLT32, 8) /* 32 bit PC relative PLT address. */
  41. RELOC_NUMBER (R_390_COPY, 9) /* Copy symbol at runtime. */
  42. RELOC_NUMBER (R_390_GLOB_DAT, 10) /* Create GOT entry. */
  43. RELOC_NUMBER (R_390_JMP_SLOT, 11) /* Create PLT entry. */
  44. RELOC_NUMBER (R_390_RELATIVE, 12) /* Adjust by program base. */
  45. RELOC_NUMBER (R_390_GOTOFF32, 13) /* 32 bit offset to GOT. */
  46. RELOC_NUMBER (R_390_GOTPC, 14) /* 32 bit PC relative offset to GOT. */
  47. RELOC_NUMBER (R_390_GOT16, 15) /* 16 bit GOT offset. */
  48. RELOC_NUMBER (R_390_PC16, 16) /* PC relative 16 bit. */
  49. RELOC_NUMBER (R_390_PC12DBL, 62) /* PC relative 12 bit shifted by 1. */
  50. RELOC_NUMBER (R_390_PLT12DBL, 63) /* 12 bit PC rel. PLT shifted by 1. */
  51. RELOC_NUMBER (R_390_PC16DBL, 17) /* PC relative 16 bit shifted by 1. */
  52. RELOC_NUMBER (R_390_PLT16DBL, 18) /* 16 bit PC rel. PLT shifted by 1. */
  53. RELOC_NUMBER (R_390_PC24DBL, 64) /* PC relative 24 bit shifted by 1. */
  54. RELOC_NUMBER (R_390_PLT24DBL, 65) /* 24 bit PC rel. PLT shifted by 1. */
  55. RELOC_NUMBER (R_390_PC32DBL, 19) /* PC relative 32 bit shifted by 1. */
  56. RELOC_NUMBER (R_390_PLT32DBL, 20) /* 32 bit PC rel. PLT shifted by 1. */
  57. RELOC_NUMBER (R_390_GOTPCDBL, 21) /* 32 bit PC rel. GOT shifted by 1. */
  58. RELOC_NUMBER (R_390_64, 22) /* Direct 64 bit. */
  59. RELOC_NUMBER (R_390_PC64, 23) /* PC relative 64 bit. */
  60. RELOC_NUMBER (R_390_GOT64, 24) /* 64 bit GOT offset. */
  61. RELOC_NUMBER (R_390_PLT64, 25) /* 64 bit PC relative PLT address. */
  62. RELOC_NUMBER (R_390_GOTENT, 26) /* 32 bit PC rel. to GOT entry >> 1. */
  63. RELOC_NUMBER (R_390_GOTOFF16, 27) /* 16 bit offset to GOT. */
  64. RELOC_NUMBER (R_390_GOTOFF64, 28) /* 64 bit offset to GOT. */
  65. RELOC_NUMBER (R_390_GOTPLT12, 29) /* 12 bit offset to jump slot. */
  66. RELOC_NUMBER (R_390_GOTPLT16, 30) /* 16 bit offset to jump slot. */
  67. RELOC_NUMBER (R_390_GOTPLT32, 31) /* 32 bit offset to jump slot. */
  68. RELOC_NUMBER (R_390_GOTPLT64, 32) /* 64 bit offset to jump slot. */
  69. RELOC_NUMBER (R_390_GOTPLTENT, 33) /* 32 bit rel. offset to jump slot. */
  70. RELOC_NUMBER (R_390_PLTOFF16, 34) /* 16 bit offset from GOT to PLT. */
  71. RELOC_NUMBER (R_390_PLTOFF32, 35) /* 32 bit offset from GOT to PLT. */
  72. RELOC_NUMBER (R_390_PLTOFF64, 36) /* 16 bit offset from GOT to PLT. */
  73. RELOC_NUMBER (R_390_TLS_LOAD, 37) /* Tag for load insn in TLS code. */
  74. RELOC_NUMBER (R_390_TLS_GDCALL, 38) /* Tag for function call in general
  75. dynamic TLS code. */
  76. RELOC_NUMBER (R_390_TLS_LDCALL, 39) /* Tag for function call in local
  77. dynamic TLS code. */
  78. RELOC_NUMBER (R_390_TLS_GD32, 40) /* Direct 32 bit for general dynamic
  79. thread local data. */
  80. RELOC_NUMBER (R_390_TLS_GD64, 41) /* Direct 64 bit for general dynamic
  81. thread local data. */
  82. RELOC_NUMBER (R_390_TLS_GOTIE12, 42)/* 12 bit GOT offset for static TLS
  83. block offset. */
  84. RELOC_NUMBER (R_390_TLS_GOTIE32, 43)/* 32 bit GOT offset for static TLS
  85. block offset. */
  86. RELOC_NUMBER (R_390_TLS_GOTIE64, 44)/* 64 bit GOT offset for static TLS
  87. block offset. */
  88. RELOC_NUMBER (R_390_TLS_LDM32, 45) /* Direct 32 bit for local dynamic
  89. thread local data in LD code. */
  90. RELOC_NUMBER (R_390_TLS_LDM64, 46) /* Direct 64 bit for local dynamic
  91. thread local data in LD code. */
  92. RELOC_NUMBER (R_390_TLS_IE32, 47) /* 32 bit address of GOT entry for
  93. negated static TLS block offset. */
  94. RELOC_NUMBER (R_390_TLS_IE64, 48) /* 64 bit address of GOT entry for
  95. negated static TLS block offset. */
  96. RELOC_NUMBER (R_390_TLS_IEENT, 49) /* 32 bit rel. offset to GOT entry for
  97. negated static TLS block offset. */
  98. RELOC_NUMBER (R_390_TLS_LE32, 50) /* 32 bit negated offset relative to
  99. static TLS block. */
  100. RELOC_NUMBER (R_390_TLS_LE64, 51) /* 64 bit negated offset relative to
  101. static TLS block. */
  102. RELOC_NUMBER (R_390_TLS_LDO32, 52) /* 32 bit offset relative to TLS
  103. block. */
  104. RELOC_NUMBER (R_390_TLS_LDO64, 53) /* 64 bit offset relative to TLS
  105. block. */
  106. RELOC_NUMBER (R_390_TLS_DTPMOD, 54) /* ID of module containing symbol. */
  107. RELOC_NUMBER (R_390_TLS_DTPOFF, 55) /* Offset in TLS block. */
  108. RELOC_NUMBER (R_390_TLS_TPOFF, 56) /* Negate offset in static TLS
  109. block. */
  110. RELOC_NUMBER (R_390_20, 57) /* Direct 20 bit. */
  111. RELOC_NUMBER (R_390_GOT20, 58) /* 20 bit GOT offset. */
  112. RELOC_NUMBER (R_390_GOTPLT20, 59) /* 20 bit offset to jump slot. */
  113. RELOC_NUMBER (R_390_TLS_GOTIE20, 60)/* 20 bit GOT offset for statis TLS
  114. block offset. */
  115. RELOC_NUMBER (R_390_IRELATIVE, 61) /* IFUNC relocation. */
  116. /* These are GNU extensions to enable C++ vtable garbage collection. */
  117. RELOC_NUMBER (R_390_GNU_VTINHERIT, 250)
  118. RELOC_NUMBER (R_390_GNU_VTENTRY, 251)
  119. END_RELOC_NUMBERS (R_390_max)
  120. /* Object attribute tags. */
  121. enum
  122. {
  123. /* 0-3 are generic. */
  124. /* 4 is reserved for the FP ABI. */
  125. /* Vector ABI:
  126. 0 = not affected by the vector ABI, or not tagged.
  127. 1 = software vector ABI being used
  128. 2 = hardware vector ABI being used. */
  129. Tag_GNU_S390_ABI_Vector = 8,
  130. };
  131. #endif /* _ELF_390_H */