i386.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // i386.h -- ELF definitions specific to EM_386 -*- C++ -*-
  2. // Copyright (C) 2006-2022 Free Software Foundation, Inc.
  3. // Written by Ian Lance Taylor <iant@google.com>.
  4. // This file is part of elfcpp.
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU Library General Public License
  7. // as published by the Free Software Foundation; either version 2, or
  8. // (at your option) any later version.
  9. // In addition to the permissions in the GNU Library General Public
  10. // License, the Free Software Foundation gives you unlimited
  11. // permission to link the compiled version of this file into
  12. // combinations with other programs, and to distribute those
  13. // combinations without any restriction coming from the use of this
  14. // file. (The Library Public License restrictions do apply in other
  15. // respects; for example, they cover modification of the file, and
  16. /// distribution when not linked into a combined executable.)
  17. // This program is distributed in the hope that it will be useful, but
  18. // WITHOUT ANY WARRANTY; without even the implied warranty of
  19. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. // Library General Public License for more details.
  21. // You should have received a copy of the GNU Library General Public
  22. // License along with this program; if not, write to the Free Software
  23. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  24. // 02110-1301, USA.
  25. #ifndef ELFCPP_I386_H
  26. #define ELFCPP_I386_H
  27. // Documentation for the TLS relocs is taken from
  28. // http://people.redhat.com/drepper/tls.pdf
  29. // http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
  30. namespace elfcpp
  31. {
  32. enum
  33. {
  34. R_386_NONE = 0, // No reloc
  35. R_386_32 = 1, // Direct 32 bit zero extended
  36. R_386_PC32 = 2, // PC relative 32 bit signed
  37. R_386_GOT32 = 3, // 32 bit GOT entry
  38. R_386_PLT32 = 4, // 32 bit PLT address
  39. R_386_COPY = 5, // Copy symbol at runtime
  40. R_386_GLOB_DAT = 6, // Create GOT entry
  41. R_386_JUMP_SLOT = 7, // Create PLT entry
  42. R_386_RELATIVE = 8, // Adjust by program base
  43. R_386_GOTOFF = 9, // 32-bit GOT offset
  44. R_386_GOTPC = 10, // 32-bit PC relative offset to GOT
  45. // Used by Sun.
  46. R_386_32PLT = 11,
  47. // TLS extensions.
  48. R_386_TLS_TPOFF = 14, // Outstanding Initial Exec reloc, gnu-style (both)
  49. R_386_TLS_IE = 15, // Initial Initial Exec reloc, gnu-style (no-PIC)
  50. R_386_TLS_GOTIE = 16, // Initial Initial Exec reloc, gnu-style (for PIC)
  51. R_386_TLS_LE = 17, // Initial Local Exec reloc, gnu-style
  52. R_386_TLS_GD = 18, // Initial General Dynamic reloc, gnu-style
  53. R_386_TLS_LDM = 19, // Initial Local Dynamic reloc, gnu-style
  54. // GNU extensions.
  55. R_386_16 = 20, // Direct 16 bit zero extended
  56. R_386_PC16 = 21, // 16 bit sign extended pc relative
  57. R_386_8 = 22, // Direct 8 bit sign extended
  58. R_386_PC8 = 23, // 8 bit sign extended pc relative
  59. // More TLS relocs.
  60. R_386_TLS_GD_32 = 24, // Initial General Dynamic reloc, sun-style
  61. R_386_TLS_GD_PUSH = 25, // Initial General Dynamic reloc, sun-style
  62. R_386_TLS_GD_CALL = 26, // Initial General Dynamic reloc, sun-style
  63. R_386_TLS_GD_POP = 27, // Initial General Dynamic reloc, sun-style
  64. R_386_TLS_LDM_32 = 28, // Initial Local Dynamic reloc, sun-style
  65. R_386_TLS_LDM_PUSH = 29, // Initial Local Dynamic reloc, sun-style
  66. R_386_TLS_LDM_CALL = 30, // Initial Local Dynamic reloc, sun-style
  67. R_386_TLS_LDM_POP = 31, // Initial Local Dynamic reloc, sun-style
  68. R_386_TLS_LDO_32 = 32, // Initial Local Dynamic reloc, sun+gnu styles
  69. R_386_TLS_IE_32 = 33, // Initial Initial Exec reloc, sun-style
  70. R_386_TLS_LE_32 = 34, // Initial Local Exec reloc, sun-style
  71. R_386_TLS_DTPMOD32 = 35, // Outstanding General/Local Dynamic reloc, sun+gnu
  72. R_386_TLS_DTPOFF32 = 36, // Outstanding General Dynamic reloc, sun+gnu
  73. R_386_TLS_TPOFF32 = 37, // Outstanding Initial Exec reloc, sun-style
  74. R_386_TLS_GOTDESC = 39, // GOT offset for TLS descriptor
  75. R_386_TLS_DESC_CALL = 40, // Marker of call through TLS desc for relaxation
  76. R_386_TLS_DESC = 41, // TLS descriptor containing pointer to code and
  77. // to argument, returning TLS offset for symbol
  78. R_386_IRELATIVE = 42, // Adjust indirectly by program base
  79. R_386_GOT32X = 43, // 32 bit GOT entry, relaxable
  80. // Used by Intel.
  81. R_386_USED_BY_INTEL_200 = 200,
  82. // GNU vtable garbage collection extensions.
  83. R_386_GNU_VTINHERIT = 250,
  84. R_386_GNU_VTENTRY = 251
  85. };
  86. } // End namespace elfcpp.
  87. #endif // !defined(ELFCPP_I386_H)