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