a06d4706d0036c638807d6fe52eebbe3e3958521
[centaur.git] / include / libelfu / types.h
1 #ifndef __LIBELFU_TYPES_H__
2 #define __LIBELFU_TYPES_H__
3
4 #include <sys/queue.h>
5
6 #include <elf.h>
7 #include <libelf/gelf.h>
8
9
10 typedef struct ElfuScn {
11   GElf_Shdr shdr;
12
13   Elf_Data data;
14
15   struct ElfuScn *linkptr;
16   struct ElfuScn *infoptr;
17
18   struct ElfuScn *oldptr;
19
20   CIRCLEQ_ENTRY(ElfuScn) elemChildScn;
21   CIRCLEQ_ENTRY(ElfuScn) elem;
22 } ElfuScn;
23
24
25 typedef struct ElfuPhdr {
26   GElf_Phdr phdr;
27
28   CIRCLEQ_HEAD(ChildScnList, ElfuScn) childScnList;
29   CIRCLEQ_HEAD(ChildPhdrList, ElfuPhdr) childPhdrList;
30
31   CIRCLEQ_ENTRY(ElfuPhdr) elemChildPhdr;
32   CIRCLEQ_ENTRY(ElfuPhdr) elem;
33 } ElfuPhdr;
34
35
36 typedef struct {
37   int elfclass;
38   GElf_Ehdr ehdr;
39
40   CIRCLEQ_HEAD(PhdrList, ElfuPhdr) phdrList;
41   CIRCLEQ_HEAD(OrphanScnList, ElfuScn) orphanScnList;
42
43   ElfuScn *shstrtab;
44 } ElfuElf;
45
46
47 #endif