source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/tools/avr/include/libelf/gelf.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

File size: 5.0 KB
Line 
1/*
2 * gelf.h - public header file for libelf.
3 * Copyright (C) 2000 - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20/* @(#) $Id: gelf.h,v 1.16 2008/05/23 08:15:34 michael Exp $ */
21
22#ifndef _GELF_H
23#define _GELF_H
24
25#if __LIBELF_INTERNAL__
26#include <libelf.h>
27#else /* __LIBELF_INTERNAL__ */
28#include <libelf/libelf.h>
29#endif /* __LIBELF_INTERNAL__ */
30
31#if __LIBELF_NEED_LINK_H
32#include <link.h>
33#elif __LIBELF_NEED_SYS_LINK_H
34#include <sys/link.h>
35#endif /* __LIBELF_NEED_LINK_H */
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cplusplus */
40
41#ifndef __P
42# if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32)
43#  define __P(args) args
44# else /* __STDC__ || defined(__cplusplus) */
45#  define __P(args) ()
46# endif /* __STDC__ || defined(__cplusplus) */
47#endif /* __P */
48
49#if !__LIBELF64
50
51#error "GElf is not supported on this system."
52
53#else /* __LIBELF64 */
54
55typedef Elf64_Addr      GElf_Addr;
56typedef Elf64_Half      GElf_Half;
57typedef Elf64_Off       GElf_Off;
58typedef Elf64_Sword     GElf_Sword;
59typedef Elf64_Word      GElf_Word;
60typedef Elf64_Sxword    GElf_Sxword;
61typedef Elf64_Xword     GElf_Xword;
62
63typedef Elf64_Ehdr      GElf_Ehdr;
64typedef Elf64_Phdr      GElf_Phdr;
65typedef Elf64_Shdr      GElf_Shdr;
66typedef Elf64_Dyn       GElf_Dyn;
67typedef Elf64_Rel       GElf_Rel;
68typedef Elf64_Rela      GElf_Rela;
69typedef Elf64_Sym       GElf_Sym;
70
71/*
72 * Symbol versioning
73 */
74#if __LIBELF_SYMBOL_VERSIONS
75typedef Elf64_Verdef    GElf_Verdef;
76typedef Elf64_Verneed   GElf_Verneed;
77typedef Elf64_Verdaux   GElf_Verdaux;
78typedef Elf64_Vernaux   GElf_Vernaux;
79#endif /* __LIBELF_SYMBOL_VERSIONS */
80
81/*
82 * These types aren't implemented (yet)
83 *
84typedef Elf64_Move    GElf_Move;
85typedef Elf64_Syminfo GElf_Syminfo;
86 */
87
88/*
89 * Generic macros
90 */
91#define GELF_ST_BIND    ELF64_ST_BIND
92#define GELF_ST_TYPE    ELF64_ST_TYPE
93#define GELF_ST_INFO    ELF64_ST_INFO
94
95#define GELF_R_TYPE     ELF64_R_TYPE
96#define GELF_R_SYM      ELF64_R_SYM
97#define GELF_R_INFO     ELF64_R_INFO
98
99/*
100 * Function declarations
101 */
102extern int             gelf_getclass __P((Elf *__elf));
103
104extern size_t             gelf_fsize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver));
105
106extern Elf_Data       *gelf_xlatetof __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode));
107extern Elf_Data       *gelf_xlatetom __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode));
108
109extern GElf_Ehdr       *gelf_getehdr __P((Elf *__elf, GElf_Ehdr *__dst));
110extern int          gelf_update_ehdr __P((Elf *__elf, GElf_Ehdr *__src));
111extern unsigned long    gelf_newehdr __P((Elf *__elf, int __elfclass));
112
113extern GElf_Phdr       *gelf_getphdr __P((Elf *__elf, int ndx, GElf_Phdr *__dst));
114extern int          gelf_update_phdr __P((Elf *__elf, int ndx, GElf_Phdr *__src));
115extern unsigned long    gelf_newphdr __P((Elf *__elf, size_t __phnum));
116
117extern GElf_Shdr       *gelf_getshdr __P((Elf_Scn *__scn, GElf_Shdr *__dst));
118extern int          gelf_update_shdr __P((Elf_Scn *__scn, GElf_Shdr *__src));
119
120extern GElf_Dyn         *gelf_getdyn __P((Elf_Data *__src, int __ndx, GElf_Dyn *__dst));
121extern int           gelf_update_dyn __P((Elf_Data *__dst, int __ndx, GElf_Dyn *__src));
122
123extern GElf_Rel         *gelf_getrel __P((Elf_Data *__src, int __ndx, GElf_Rel *__dst));
124extern int           gelf_update_rel __P((Elf_Data *__dst, int __ndx, GElf_Rel *__src));
125
126extern GElf_Rela       *gelf_getrela __P((Elf_Data *__src, int __ndx, GElf_Rela *__dst));
127extern int          gelf_update_rela __P((Elf_Data *__dst, int __ndx, GElf_Rela *__src));
128
129extern GElf_Sym         *gelf_getsym __P((Elf_Data *__src, int __ndx, GElf_Sym *__dst));
130extern int           gelf_update_sym __P((Elf_Data *__dst, int __ndx, GElf_Sym *__src));
131
132extern long            gelf_checksum __P((Elf *__elf));
133
134/*
135 * These functions aren't implemented (yet)
136 *
137extern GElf_Move       *gelf_getmove __P((Elf_Data *__src, int __ndx, GElf_Move *__src));
138extern int          gelf_update_move __P((Elf_Data *__dst, int __ndx, GElf_Move *__src));
139 *
140extern GElf_Syminfo* gelf_getsyminfo __P((Elf_Data *__src, int __ndx, GElf_Syminfo *__dst));
141extern int       gelf_update_syminfo __P((Elf_Data *__dst, int __ndx, GElf_Syminfo *__src));
142 */
143
144/*
145 * Extensions (not available in other versions of libelf)
146 */
147extern size_t             gelf_msize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver));
148
149#endif /* __LIBELF64 */
150
151#ifdef __cplusplus
152}
153#endif /* __cplusplus */
154
155#endif /* _GELF_H */
Note: See TracBrowser for help on using the repository browser.