Guess where unknown functions are in .rel.plt
[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 <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   struct ElfuSymtab *symtab;
21   struct ElfuReltab *reltab;
22
23   CIRCLEQ_ENTRY(ElfuScn) elemChildScn;
24   CIRCLEQ_ENTRY(ElfuScn) elem;
25 } ElfuScn;
26
27
28 typedef struct ElfuPhdr {
29   GElf_Phdr phdr;
30
31   CIRCLEQ_HEAD(ChildScnList, ElfuScn) childScnList;
32   CIRCLEQ_HEAD(ChildPhdrList, ElfuPhdr) childPhdrList;
33
34   CIRCLEQ_ENTRY(ElfuPhdr) elemChildPhdr;
35   CIRCLEQ_ENTRY(ElfuPhdr) elem;
36 } ElfuPhdr;
37
38
39 typedef struct {
40   int elfclass;
41   GElf_Ehdr ehdr;
42
43   CIRCLEQ_HEAD(PhdrList, ElfuPhdr) phdrList;
44   CIRCLEQ_HEAD(OrphanScnList, ElfuScn) orphanScnList;
45
46   ElfuScn *shstrtab;
47 } ElfuElf;
48
49
50
51
52
53 typedef struct ElfuSym {
54   char *name;
55
56   GElf_Addr value;
57   GElf_Word size;
58
59   unsigned char bind;
60   unsigned char type;
61   unsigned char other;
62
63   ElfuScn *scnptr;
64   int shndx;
65
66   CIRCLEQ_ENTRY(ElfuSym) elem;
67 } ElfuSym;
68
69
70 typedef struct ElfuSymtab {
71   CIRCLEQ_HEAD(Syms, ElfuSym) syms;
72 } ElfuSymtab;
73
74
75
76 typedef struct ElfuRel {
77   char *name;
78
79   GElf_Addr offset;
80   GElf_Word info;
81
82   GElf_Word sym;
83   unsigned char type;
84
85   int addendUsed;
86   GElf_Sword addend;
87
88   CIRCLEQ_ENTRY(ElfuRel) elem;
89 } ElfuRel;
90
91
92 typedef struct ElfuReltab {
93   CIRCLEQ_HEAD(Rels, ElfuRel) rels;
94 } ElfuReltab;
95
96
97 #endif