test_elf.h
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #ifndef TEST_ELF
23 #define TEST_ELF
24 
25 #include <bfelf_loader.h>
26 
27 #pragma pack(push, 1)
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
34 {
35  bfelf_phdr re_segment;
36  bfelf_phdr rw_segment;
37  bfelf_phdr dyn_segment;
38  bfelf_phdr stack_segment;
39  bfelf_phdr relro_segment;
40 };
41 
42 struct test_hash
43 {
44  bfelf64_word nbucket;
45  bfelf64_word nchain;
46  bfelf64_word index1;
47  bfelf64_word index2;
48  bfelf64_word hash1;
49  bfelf64_word hash2;
50 };
51 
53 {
54  bfelf_sym syms[2];
55 };
56 
58 {
59  char str1[10];
60  char str2[10];
61  char str3[10];
62  char str4[10];
63 };
64 
66 {
67  struct bfelf_rela relas[2];
68 };
69 
71 {
72  const char *reserved[10];
73 };
74 
76 {
77  const char *reserved[10];
78 };
79 
81 {
82  const char *reserved[10];
83 };
84 
86 {
87  struct bfelf_dyn needed1;
88  struct bfelf_dyn needed2;
89  struct bfelf_dyn pltgot;
90  struct bfelf_dyn strtab;
91  struct bfelf_dyn symtab;
92  struct bfelf_dyn rela;
93  struct bfelf_dyn relasz;
94  struct bfelf_dyn relaent;
95  struct bfelf_dyn strsz;
96  struct bfelf_dyn init;
97  struct bfelf_dyn fini;
98  struct bfelf_dyn init_array;
99  struct bfelf_dyn fini_array;
100  struct bfelf_dyn init_arraysz;
101  struct bfelf_dyn fini_arraysz;
102  struct bfelf_dyn flags_1;
103  struct bfelf_dyn last;
104 };
105 
107 {
108  bfelf_shdr hash;
109  bfelf_shdr dynsym;
110  bfelf_shdr dynstr;
111  bfelf_shdr relatab;
112  bfelf_shdr eh_frame;
113  bfelf_shdr init_array;
114  bfelf_shdr fini_array;
115  bfelf_shdr dynamic;
116  bfelf_shdr ctors;
117  bfelf_shdr dtors;
118 };
119 
121 {
122  bfelf_ehdr header;
124 
133 
135 };
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #pragma pack(pop)
142 
143 #endif
bfelf_shdr dtors
Definition: test_elf.h:117
struct bfelf_dyn relasz
Definition: test_elf.h:93
test_dynamic dynamic
Definition: test_elf.h:132
struct bfelf_dyn relaent
Definition: test_elf.h:94
struct bfelf_dyn fini_array
Definition: test_elf.h:99
struct bfelf_dyn fini_arraysz
Definition: test_elf.h:101
struct bfelf_dyn pltgot
Definition: test_elf.h:89
struct bfelf_dyn init_array
Definition: test_elf.h:98
const char * reserved[10]
Definition: test_elf.h:77
bfelf_shdr dynsym
Definition: test_elf.h:109
struct bfelf_dyn strtab
Definition: test_elf.h:90
struct bfelf_dyn needed1
Definition: test_elf.h:87
const char * reserved[10]
Definition: test_elf.h:72
bfelf_shdr dynamic
Definition: test_elf.h:115
test_phdrtab phdrtab
Definition: test_elf.h:123
bfelf_shdr hash
Definition: test_elf.h:108
bfelf_shdr fini_array
Definition: test_elf.h:114
bfelf64_word index2
Definition: test_elf.h:47
test_shdrtab shdrtab
Definition: test_elf.h:134
bfelf_phdr rw_segment
Definition: test_elf.h:36
bfelf_shdr ctors
Definition: test_elf.h:116
bfelf_ehdr header
Definition: test_elf.h:122
bfelf_phdr relro_segment
Definition: test_elf.h:39
bfelf_sym syms[2]
Definition: test_elf.h:54
test_dynstr dynstr
Definition: test_elf.h:126
bfelf64_word hash2
Definition: test_elf.h:49
test_eh_frame eh_frame
Definition: test_elf.h:129
test_dynsym dynsym
Definition: test_elf.h:125
bfelf64_word index1
Definition: test_elf.h:46
bfelf64_word nbucket
Definition: test_elf.h:44
struct bfelf_dyn flags_1
Definition: test_elf.h:102
bfelf_shdr relatab
Definition: test_elf.h:111
test_relatab relatab
Definition: test_elf.h:128
test_hash hash
Definition: test_elf.h:127
const char * reserved[10]
Definition: test_elf.h:82
bfelf64_word nchain
Definition: test_elf.h:45
struct bfelf_dyn init_arraysz
Definition: test_elf.h:100
test_init_array init_array
Definition: test_elf.h:130
test_fini_array fini_array
Definition: test_elf.h:131
bfelf_phdr dyn_segment
Definition: test_elf.h:37
bfelf_phdr stack_segment
Definition: test_elf.h:38
char str1[10]
Definition: test_elf.h:59
char str2[10]
Definition: test_elf.h:60
struct bfelf_rela relas[2]
Definition: test_elf.h:67
struct bfelf_dyn needed2
Definition: test_elf.h:88
bfelf64_word hash1
Definition: test_elf.h:48
bfelf_shdr init_array
Definition: test_elf.h:113
struct bfelf_dyn rela
Definition: test_elf.h:92
struct bfelf_dyn fini
Definition: test_elf.h:97
bfelf_shdr eh_frame
Definition: test_elf.h:112
struct bfelf_dyn strsz
Definition: test_elf.h:95
char str3[10]
Definition: test_elf.h:61
struct bfelf_dyn last
Definition: test_elf.h:103
bfelf_phdr re_segment
Definition: test_elf.h:35
struct bfelf_dyn symtab
Definition: test_elf.h:91
struct bfelf_dyn init
Definition: test_elf.h:96
char str4[10]
Definition: test_elf.h:62
bfelf_shdr dynstr
Definition: test_elf.h:110