xref: /haiku/headers/private/kernel/boot/elf.h (revision 957a1b17eb9d13d6dbf164145e82997e16742549)
1b73b3e5aSAxel Dörfler /*
262dbb799SAxel Dörfler ** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3b73b3e5aSAxel Dörfler ** Distributed under the terms of the OpenBeOS License.
4b73b3e5aSAxel Dörfler */
5b73b3e5aSAxel Dörfler #ifndef KERNEL_BOOT_ELF_H
6b73b3e5aSAxel Dörfler #define KERNEL_BOOT_ELF_H
7b73b3e5aSAxel Dörfler 
8b73b3e5aSAxel Dörfler 
9ca109e72SAxel Dörfler #include <boot/addr_range.h>
10e07c1f2cSAxel Dörfler #include <sys/stat.h>
11b73b3e5aSAxel Dörfler #include <elf_priv.h>
12b73b3e5aSAxel Dörfler 
13b73b3e5aSAxel Dörfler 
14b73b3e5aSAxel Dörfler struct preloaded_image {
15b73b3e5aSAxel Dörfler 	struct preloaded_image *next;
16b73b3e5aSAxel Dörfler 	char		*name;
17b73b3e5aSAxel Dörfler 	elf_region	text_region;
18b73b3e5aSAxel Dörfler 	elf_region	data_region;
19c2c0779eSAxel Dörfler 	addr_range	dynamic_section;
201bde925eSAxel Dörfler 	struct Elf32_Ehdr elf_header;
216e062dd1SAxel Dörfler 
22*957a1b17SIngo Weinhold 	struct Elf32_Sym	*syms;
23*957a1b17SIngo Weinhold 	struct Elf32_Rel	*rel;
24*957a1b17SIngo Weinhold 	int					rel_len;
25*957a1b17SIngo Weinhold 	struct Elf32_Rela	*rela;
26*957a1b17SIngo Weinhold 	int					rela_len;
27*957a1b17SIngo Weinhold 	struct Elf32_Rel	*pltrel;
28*957a1b17SIngo Weinhold 	int					pltrel_len;
29*957a1b17SIngo Weinhold 	int					pltrel_type;
30*957a1b17SIngo Weinhold 
31fa1ddc4fSAxel Dörfler 	struct Elf32_Sym *debug_symbols;
32fa1ddc4fSAxel Dörfler 	const char	*debug_string_table;
33fa1ddc4fSAxel Dörfler 	uint32		num_debug_symbols, debug_string_table_size;
34fa1ddc4fSAxel Dörfler 
35e07c1f2cSAxel Dörfler 	ino_t		inode;
366e062dd1SAxel Dörfler 	image_id	id;
376e062dd1SAxel Dörfler 		// the ID field will be filled out in the kernel
38b73b3e5aSAxel Dörfler };
39b73b3e5aSAxel Dörfler 
40*957a1b17SIngo Weinhold #ifdef __cplusplus
41*957a1b17SIngo Weinhold extern "C" {
42*957a1b17SIngo Weinhold #endif
43*957a1b17SIngo Weinhold 
44*957a1b17SIngo Weinhold extern status_t boot_elf_resolve_symbol(struct preloaded_image *image,
45*957a1b17SIngo Weinhold 	struct Elf32_Sym *symbol, addr_t *symbolAddress);
46*957a1b17SIngo Weinhold 
47*957a1b17SIngo Weinhold #ifdef __cplusplus
48*957a1b17SIngo Weinhold }
49*957a1b17SIngo Weinhold #endif
50*957a1b17SIngo Weinhold 
51b73b3e5aSAxel Dörfler #endif	/* KERNEL_BOOT_ELF_H */
52