3 libelf.h - public header file for libelf.
4 Copyright (C) 1995 Michael Riepe <riepe@ifwsn4.ifw.uni-hannover.de>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <sys/types.h>
32 # if __STDC__ || defined(__cplusplus)
33 # define __P(args) args
43 ELF_C_NULL = 0, /* must be first, 0 */
51 ELF_C_NUM /* must be last */
58 #define ELF_F_DIRTY 0x1
59 #define ELF_F_LAYOUT 0x4
65 ELF_K_NONE = 0, /* must be first, 0 */
69 ELF_K_NUM /* must be last */
76 ELF_T_BYTE = 0, /* must be first, 0 */
89 ELF_T_NUM /* must be last */
95 typedef struct Elf Elf;
100 typedef struct Elf_Scn Elf_Scn;
103 * Archive member header
110 unsigned long ar_mode;
116 * Archive symbol table
121 unsigned long as_hash;
137 * Function declarations
139 extern Elf *elf_begin __P((int __fd, Elf_Cmd __cmd, Elf *__ref));
140 extern int elf_cntl __P((Elf *__elf, Elf_Cmd __cmd));
141 extern int elf_end __P((Elf *__elf));
142 extern const char *elf_errmsg __P((int __err));
143 extern int elf_errno __P((void));
144 extern void elf_fill __P((int __fill));
145 extern unsigned elf_flagdata __P((Elf_Data *__data, Elf_Cmd __cmd,
147 extern unsigned elf_flagehdr __P((Elf *__elf, Elf_Cmd __cmd,
149 extern unsigned elf_flagelf __P((Elf *__elf, Elf_Cmd __cmd,
151 extern unsigned elf_flagphdr __P((Elf *__elf, Elf_Cmd __cmd,
153 extern unsigned elf_flagscn __P((Elf_Scn *__scn, Elf_Cmd __cmd,
155 extern unsigned elf_flagshdr __P((Elf_Scn *__scn, Elf_Cmd __cmd,
157 extern size_t elf32_fsize __P((Elf_Type __type, size_t __count,
159 extern Elf_Arhdr *elf_getarhdr __P((Elf *__elf));
160 extern Elf_Arsym *elf_getarsym __P((Elf *__elf, size_t *__ptr));
161 extern off_t elf_getbase __P((Elf *__elf));
162 extern Elf_Data *elf_getdata __P((Elf_Scn *__scn, Elf_Data *__data));
163 extern Elf32_Ehdr *elf32_getehdr __P((Elf *__elf));
164 extern char *elf_getident __P((Elf *__elf, size_t *__ptr));
165 extern Elf32_Phdr *elf32_getphdr __P((Elf *__elf));
166 extern Elf_Scn *elf_getscn __P((Elf *__elf, size_t __index));
167 extern Elf32_Shdr *elf32_getshdr __P((Elf_Scn *__scn));
168 extern unsigned long elf_hash __P((const char *__name));
169 extern Elf_Kind elf_kind __P((Elf *__elf));
170 extern size_t elf_ndxscn __P((Elf_Scn *__scn));
171 extern Elf_Data *elf_newdata __P((Elf_Scn *__scn));
172 extern Elf32_Ehdr *elf32_newehdr __P((Elf *__elf));
173 extern Elf32_Phdr *elf32_newphdr __P((Elf *__elf, size_t __count));
174 extern Elf_Scn *elf_newscn __P((Elf *__elf));
175 extern Elf_Cmd elf_next __P((Elf *__elf));
176 extern Elf_Scn *elf_nextscn __P((Elf *__elf, Elf_Scn *__scn));
177 extern size_t elf_rand __P((Elf *__elf, size_t __offset));
178 extern Elf_Data *elf_rawdata __P((Elf_Scn *__scn, Elf_Data *__data));
179 extern char *elf_rawfile __P((Elf *__elf, size_t *__ptr));
180 extern char *elf_strptr __P((Elf *__elf, size_t __section, size_t __offset));
181 extern off_t elf_update __P((Elf *__elf, Elf_Cmd __cmd));
182 extern unsigned elf_version __P((unsigned __ver));
183 extern Elf_Data *elf32_xlatetof __P((Elf_Data *__dst, const Elf_Data *__src,
185 extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
192 #endif /* _LIBELF_H */