sys_elf.h.w32 4.0 KB

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