sys_elf.h.in 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. sys_elf.h.in - configure template for private "switch" file.
  3. Copyright (C) 1998 - 2001 Michael Riepe
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library 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 GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  15. */
  16. /* @(#) $Id: sys_elf.h.in,v 1.13 2008/05/23 08:57:07 michael Exp $ */
  17. /*
  18. * DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD!
  19. */
  20. /* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
  21. #undef __LIBELF_HEADER_ELF_H
  22. /* Define if Elf32_Dyn is declared in <link.h> */
  23. #undef __LIBELF_NEED_LINK_H
  24. /* Define if Elf32_Dyn is declared in <sys/link.h> */
  25. #undef __LIBELF_NEED_SYS_LINK_H
  26. /* Define if you want 64-bit support (and your system supports it) */
  27. #undef __LIBELF64
  28. /* Define if you want 64-bit support, and are running IRIX */
  29. #undef __LIBELF64_IRIX
  30. /* Define if you want 64-bit support, and are running Linux */
  31. #undef __LIBELF64_LINUX
  32. /* Define if you want symbol versioning (and your system supports it) */
  33. #undef __LIBELF_SYMBOL_VERSIONS
  34. /* Define to a 64-bit signed integer type if one exists */
  35. #undef __libelf_i64_t
  36. /* Define to a 64-bit unsigned integer type if one exists */
  37. #undef __libelf_u64_t
  38. /* Define to a 32-bit signed integer type if one exists */
  39. #undef __libelf_i32_t
  40. /* Define to a 32-bit unsigned integer type if one exists */
  41. #undef __libelf_u32_t
  42. /* Define to a 16-bit signed integer type if one exists */
  43. #undef __libelf_i16_t
  44. /* Define to a 16-bit unsigned integer type if one exists */
  45. #undef __libelf_u16_t
  46. /*
  47. * Ok, now get the correct instance of elf.h...
  48. */
  49. #ifdef __LIBELF_HEADER_ELF_H
  50. # include __LIBELF_HEADER_ELF_H
  51. #else /* __LIBELF_HEADER_ELF_H */
  52. # if __LIBELF_INTERNAL__
  53. # include <elf_repl.h>
  54. # else /* __LIBELF_INTERNAL__ */
  55. # include <libelf/elf_repl.h>
  56. # endif /* __LIBELF_INTERNAL__ */
  57. #endif /* __LIBELF_HEADER_ELF_H */
  58. /*
  59. * On some systems, <elf.h> is severely broken. Try to fix it.
  60. */
  61. #ifdef __LIBELF_HEADER_ELF_H
  62. # ifndef ELF32_FSZ_ADDR
  63. # define ELF32_FSZ_ADDR 4
  64. # define ELF32_FSZ_HALF 2
  65. # define ELF32_FSZ_OFF 4
  66. # define ELF32_FSZ_SWORD 4
  67. # define ELF32_FSZ_WORD 4
  68. # endif /* ELF32_FSZ_ADDR */
  69. # ifndef STN_UNDEF
  70. # define STN_UNDEF 0
  71. # endif /* STN_UNDEF */
  72. # if __LIBELF64
  73. # ifndef ELF64_FSZ_ADDR
  74. # define ELF64_FSZ_ADDR 8
  75. # define ELF64_FSZ_HALF 2
  76. # define ELF64_FSZ_OFF 8
  77. # define ELF64_FSZ_SWORD 4
  78. # define ELF64_FSZ_WORD 4
  79. # define ELF64_FSZ_SXWORD 8
  80. # define ELF64_FSZ_XWORD 8
  81. # endif /* ELF64_FSZ_ADDR */
  82. # ifndef ELF64_ST_BIND
  83. # define ELF64_ST_BIND(i) ((i)>>4)
  84. # define ELF64_ST_TYPE(i) ((i)&0xf)
  85. # define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
  86. # endif /* ELF64_ST_BIND */
  87. # ifndef ELF64_R_SYM
  88. # define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
  89. # define ELF64_R_TYPE(i) ((i)&0xffffffffL)
  90. # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
  91. # endif /* ELF64_R_SYM */
  92. # if __LIBELF64_LINUX
  93. typedef __libelf_u64_t Elf64_Addr;
  94. typedef __libelf_u16_t Elf64_Half;
  95. typedef __libelf_u64_t Elf64_Off;
  96. typedef __libelf_i32_t Elf64_Sword;
  97. typedef __libelf_u32_t Elf64_Word;
  98. typedef __libelf_i64_t Elf64_Sxword;
  99. typedef __libelf_u64_t Elf64_Xword;
  100. # endif /* __LIBELF64_LINUX */
  101. # endif /* __LIBELF64 */
  102. #endif /* __LIBELF_HEADER_ELF_H */