2 sys_elf.h.in - configure template for private "switch" file.
3 Copyright (C) 1998 - 2001 Michael Riepe
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 /* @(#) $Id: sys_elf.h.in,v 1.13 2008/05/23 08:57:07 michael Exp $ */
23 * DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD!
26 /* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */
27 #undef __LIBELF_HEADER_ELF_H
29 /* Define if Elf32_Dyn is declared in <link.h> */
30 #undef __LIBELF_NEED_LINK_H
32 /* Define if Elf32_Dyn is declared in <sys/link.h> */
33 #undef __LIBELF_NEED_SYS_LINK_H
35 /* Define if you want 64-bit support (and your system supports it) */
38 /* Define if you want 64-bit support, and are running IRIX */
39 #undef __LIBELF64_IRIX
41 /* Define if you want 64-bit support, and are running Linux */
42 #undef __LIBELF64_LINUX
44 /* Define if you want symbol versioning (and your system supports it) */
45 #undef __LIBELF_SYMBOL_VERSIONS
47 /* Define to a 64-bit signed integer type if one exists */
50 /* Define to a 64-bit unsigned integer type if one exists */
53 /* Define to a 32-bit signed integer type if one exists */
56 /* Define to a 32-bit unsigned integer type if one exists */
59 /* Define to a 16-bit signed integer type if one exists */
62 /* Define to a 16-bit unsigned integer type if one exists */
66 * Ok, now get the correct instance of elf.h...
68 #ifdef __LIBELF_HEADER_ELF_H
69 # include __LIBELF_HEADER_ELF_H
70 #else /* __LIBELF_HEADER_ELF_H */
71 # if __LIBELF_INTERNAL__
72 # include <elf_repl.h>
73 # else /* __LIBELF_INTERNAL__ */
74 # include <libelf/elf_repl.h>
75 # endif /* __LIBELF_INTERNAL__ */
76 #endif /* __LIBELF_HEADER_ELF_H */
79 * On some systems, <elf.h> is severely broken. Try to fix it.
81 #ifdef __LIBELF_HEADER_ELF_H
83 # ifndef ELF32_FSZ_ADDR
84 # define ELF32_FSZ_ADDR 4
85 # define ELF32_FSZ_HALF 2
86 # define ELF32_FSZ_OFF 4
87 # define ELF32_FSZ_SWORD 4
88 # define ELF32_FSZ_WORD 4
89 # endif /* ELF32_FSZ_ADDR */
93 # endif /* STN_UNDEF */
97 # ifndef ELF64_FSZ_ADDR
98 # define ELF64_FSZ_ADDR 8
99 # define ELF64_FSZ_HALF 2
100 # define ELF64_FSZ_OFF 8
101 # define ELF64_FSZ_SWORD 4
102 # define ELF64_FSZ_WORD 4
103 # define ELF64_FSZ_SXWORD 8
104 # define ELF64_FSZ_XWORD 8
105 # endif /* ELF64_FSZ_ADDR */
107 # ifndef ELF64_ST_BIND
108 # define ELF64_ST_BIND(i) ((i)>>4)
109 # define ELF64_ST_TYPE(i) ((i)&0xf)
110 # define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
111 # endif /* ELF64_ST_BIND */
114 # define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
115 # define ELF64_R_TYPE(i) ((i)&0xffffffffL)
116 # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
117 # endif /* ELF64_R_SYM */
119 # if __LIBELF64_LINUX
120 typedef __libelf_u64_t Elf64_Addr;
121 typedef __libelf_u16_t Elf64_Half;
122 typedef __libelf_u64_t Elf64_Off;
123 typedef __libelf_i32_t Elf64_Sword;
124 typedef __libelf_u32_t Elf64_Word;
125 typedef __libelf_i64_t Elf64_Sxword;
126 typedef __libelf_u64_t Elf64_Xword;
127 # endif /* __LIBELF64_LINUX */
129 # endif /* __LIBELF64 */
130 #endif /* __LIBELF_HEADER_ELF_H */