|
1 /* |
|
2 sys_elf.h.in - configure template for private "switch" file. |
|
3 Copyright (C) 1998 - 2001 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 |
|
20 /* @(#) $Id: sys_elf.h.in,v 1.12 2006/09/07 15:55:42 michael Exp $ */ |
|
21 |
|
22 /* |
|
23 * DO NOT USE THIS IN APPLICATIONS - #include <libelf.h> INSTEAD! |
|
24 */ |
|
25 |
|
26 /* Define to `<elf.h>' or `<sys/elf.h>' if one of them is present */ |
|
27 #undef __LIBELF_HEADER_ELF_H |
|
28 |
|
29 /* Define if Elf32_Dyn is declared in <link.h> */ |
|
30 #undef __LIBELF_NEED_LINK_H |
|
31 |
|
32 /* Define if Elf32_Dyn is declared in <sys/link.h> */ |
|
33 #undef __LIBELF_NEED_SYS_LINK_H |
|
34 |
|
35 /* Define if you want 64-bit support (and your system supports it) */ |
|
36 #undef __LIBELF64 |
|
37 |
|
38 /* Define if you want 64-bit support, and are running IRIX */ |
|
39 #undef __LIBELF64_IRIX |
|
40 |
|
41 /* Define if you want 64-bit support, and are running Linux */ |
|
42 #undef __LIBELF64_LINUX |
|
43 |
|
44 /* Define if you want symbol versioning (and your system supports it) */ |
|
45 #undef __LIBELF_SYMBOL_VERSIONS |
|
46 |
|
47 /* Define to a 64-bit signed integer type if one exists */ |
|
48 #undef __libelf_i64_t |
|
49 |
|
50 /* Define to a 64-bit unsigned integer type if one exists */ |
|
51 #undef __libelf_u64_t |
|
52 |
|
53 /* Define to a 32-bit signed integer type if one exists */ |
|
54 #undef __libelf_i32_t |
|
55 |
|
56 /* Define to a 32-bit unsigned integer type if one exists */ |
|
57 #undef __libelf_u32_t |
|
58 |
|
59 /* Define to a 16-bit signed integer type if one exists */ |
|
60 #undef __libelf_i16_t |
|
61 |
|
62 /* Define to a 16-bit unsigned integer type if one exists */ |
|
63 #undef __libelf_u16_t |
|
64 |
|
65 /* |
|
66 * Ok, now get the correct instance of elf.h... |
|
67 */ |
|
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 */ |
|
77 |
|
78 /* |
|
79 * On some systems, <elf.h> is severely broken. Try to fix it. |
|
80 */ |
|
81 #ifdef __LIBELF_HEADER_ELF_H |
|
82 |
|
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 */ |
|
90 |
|
91 # ifndef STN_UNDEF |
|
92 # define STN_UNDEF 0 |
|
93 # endif /* STN_UNDEF */ |
|
94 |
|
95 # if __LIBELF64 |
|
96 |
|
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 */ |
|
106 |
|
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 */ |
|
112 |
|
113 # ifndef ELF64_R_SYM |
|
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 */ |
|
118 |
|
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 */ |
|
128 |
|
129 # endif /* __LIBELF64 */ |
|
130 #endif /* __LIBELF_HEADER_ELF_H */ |