1/*
2 * @TAG(OTHER_MIT)
3 */
4/*
5 * Copyright �� 2005-2014 Rich Felker, et al.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27#pragma once
28
29#include <sel4runtime/stdint.h>
30
31/*
32 * This is a minimal definition of the ELF headers that is sufficient
33 * for sel4runtime to pass through program headers.
34 */
35
36typedef sel4runtime_uint16_t Elf32_Half;
37typedef sel4runtime_uint16_t Elf64_Half;
38
39typedef sel4runtime_uint32_t Elf32_Word;
40typedef sel4runtime_int32_t  Elf32_Sword;
41typedef sel4runtime_uint32_t Elf64_Word;
42typedef sel4runtime_int32_t  Elf64_Sword;
43
44typedef sel4runtime_uint64_t Elf32_Xword;
45typedef sel4runtime_int64_t  Elf32_Sxword;
46typedef sel4runtime_uint64_t Elf64_Xword;
47typedef sel4runtime_int64_t  Elf64_Sxword;
48
49typedef sel4runtime_uint32_t Elf32_Addr;
50typedef sel4runtime_uint64_t Elf64_Addr;
51
52typedef sel4runtime_uint32_t Elf32_Off;
53typedef sel4runtime_uint64_t Elf64_Off;
54
55typedef sel4runtime_uint16_t Elf32_Section;
56typedef sel4runtime_uint16_t Elf64_Section;
57
58typedef struct {
59    Elf32_Word  p_type;
60    Elf32_Off   p_offset;
61    Elf32_Addr  p_vaddr;
62    Elf32_Addr  p_paddr;
63    Elf32_Word  p_filesz;
64    Elf32_Word  p_memsz;
65    Elf32_Word  p_flags;
66    Elf32_Word  p_align;
67} Elf32_Phdr;
68
69typedef struct {
70    Elf64_Word   p_type;
71    Elf64_Word   p_flags;
72    Elf64_Off    p_offset;
73    Elf64_Addr   p_vaddr;
74    Elf64_Addr   p_paddr;
75    Elf64_Xword  p_filesz;
76    Elf64_Xword  p_memsz;
77    Elf64_Xword  p_align;
78} Elf64_Phdr;
79