alpha.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* ALPHA ELF support for BFD.
  2. Copyright (C) 1996-2022 Free Software Foundation, Inc.
  3. By Eric Youngdale, <eric@aib.com>. No processor supplement available
  4. for this platform.
  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 ALPHA ELF ABI. Note
  19. that most of this is not actually implemented by BFD. */
  20. #ifndef _ELF_ALPHA_H
  21. #define _ELF_ALPHA_H
  22. /* Processor specific flags for the ELF header e_flags field. */
  23. /* All addresses must be below 2GB. */
  24. #define EF_ALPHA_32BIT 0x00000001
  25. /* All relocations needed for relaxation with code movement are present. */
  26. #define EF_ALPHA_CANRELAX 0x00000002
  27. /* Processor specific section flags. */
  28. /* This section must be in the global data area. */
  29. #define SHF_ALPHA_GPREL 0x10000000
  30. /* Section contains some sort of debugging information. The exact
  31. format is unspecified. It's probably ECOFF symbols. */
  32. #define SHT_ALPHA_DEBUG 0x70000001
  33. /* Section contains register usage information. */
  34. #define SHT_ALPHA_REGINFO 0x70000002
  35. /* A section of type SHT_MIPS_REGINFO contains the following
  36. structure. */
  37. typedef struct
  38. {
  39. /* Mask of general purpose registers used. */
  40. unsigned long ri_gprmask;
  41. /* Mask of co-processor registers used. */
  42. unsigned long ri_cprmask[4];
  43. /* GP register value for this object file. */
  44. long ri_gp_value;
  45. } Elf64_RegInfo;
  46. /* Special values for the st_other field in the symbol table. */
  47. #define STO_ALPHA_NOPV 0x80
  48. #define STO_ALPHA_STD_GPLOAD 0x88
  49. /* Special values for Elf64_Dyn tag. */
  50. #define DT_ALPHA_PLTRO DT_LOPROC
  51. #include "elf/reloc-macros.h"
  52. /* Alpha relocs. */
  53. START_RELOC_NUMBERS (elf_alpha_reloc_type)
  54. RELOC_NUMBER (R_ALPHA_NONE, 0) /* No reloc */
  55. RELOC_NUMBER (R_ALPHA_REFLONG, 1) /* Direct 32 bit */
  56. RELOC_NUMBER (R_ALPHA_REFQUAD, 2) /* Direct 64 bit */
  57. RELOC_NUMBER (R_ALPHA_GPREL32, 3) /* GP relative 32 bit */
  58. RELOC_NUMBER (R_ALPHA_LITERAL, 4) /* GP relative 16 bit w/optimization */
  59. RELOC_NUMBER (R_ALPHA_LITUSE, 5) /* Optimization hint for LITERAL */
  60. RELOC_NUMBER (R_ALPHA_GPDISP, 6) /* Add displacement to GP */
  61. RELOC_NUMBER (R_ALPHA_BRADDR, 7) /* PC+4 relative 23 bit shifted */
  62. RELOC_NUMBER (R_ALPHA_HINT, 8) /* PC+4 relative 16 bit shifted */
  63. RELOC_NUMBER (R_ALPHA_SREL16, 9) /* PC relative 16 bit */
  64. RELOC_NUMBER (R_ALPHA_SREL32, 10) /* PC relative 32 bit */
  65. RELOC_NUMBER (R_ALPHA_SREL64, 11) /* PC relative 64 bit */
  66. /* Skip 12 - 16; deprecated ECOFF relocs. */
  67. RELOC_NUMBER (R_ALPHA_GPRELHIGH, 17) /* GP relative 32 bit, high 16 bits */
  68. RELOC_NUMBER (R_ALPHA_GPRELLOW, 18) /* GP relative 32 bit, low 16 bits */
  69. RELOC_NUMBER (R_ALPHA_GPREL16, 19) /* GP relative 16 bit */
  70. /* Skip 20 - 23; deprecated ECOFF relocs. */
  71. /* These relocations are specific to shared libraries. */
  72. RELOC_NUMBER (R_ALPHA_COPY, 24) /* Copy symbol at runtime */
  73. RELOC_NUMBER (R_ALPHA_GLOB_DAT, 25) /* Create GOT entry */
  74. RELOC_NUMBER (R_ALPHA_JMP_SLOT, 26) /* Create PLT entry */
  75. RELOC_NUMBER (R_ALPHA_RELATIVE, 27) /* Adjust by program base */
  76. /* Like BRADDR, but assert that the source and target object file
  77. share the same GP value, and adjust the target address for
  78. STO_ALPHA_STD_GPLOAD. */
  79. RELOC_NUMBER (R_ALPHA_BRSGP, 28)
  80. /* Thread-Local Storage. */
  81. RELOC_NUMBER (R_ALPHA_TLSGD, 29)
  82. RELOC_NUMBER (R_ALPHA_TLSLDM, 30)
  83. RELOC_NUMBER (R_ALPHA_DTPMOD64, 31)
  84. RELOC_NUMBER (R_ALPHA_GOTDTPREL, 32)
  85. RELOC_NUMBER (R_ALPHA_DTPREL64, 33)
  86. RELOC_NUMBER (R_ALPHA_DTPRELHI, 34)
  87. RELOC_NUMBER (R_ALPHA_DTPRELLO, 35)
  88. RELOC_NUMBER (R_ALPHA_DTPREL16, 36)
  89. RELOC_NUMBER (R_ALPHA_GOTTPREL, 37)
  90. RELOC_NUMBER (R_ALPHA_TPREL64, 38)
  91. RELOC_NUMBER (R_ALPHA_TPRELHI, 39)
  92. RELOC_NUMBER (R_ALPHA_TPRELLO, 40)
  93. RELOC_NUMBER (R_ALPHA_TPREL16, 41)
  94. END_RELOC_NUMBERS (R_ALPHA_max)
  95. #define LITUSE_ALPHA_ADDR 0
  96. #define LITUSE_ALPHA_BASE 1
  97. #define LITUSE_ALPHA_BYTOFF 2
  98. #define LITUSE_ALPHA_JSR 3
  99. #define LITUSE_ALPHA_TLSGD 4
  100. #define LITUSE_ALPHA_TLSLDM 5
  101. #define LITUSE_ALPHA_JSRDIRECT 6
  102. #endif /* _ELF_ALPHA_H */