xref: /haiku/headers/private/kernel/boot/elf.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
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 };
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 extern status_t boot_elf_resolve_symbol(struct preloaded_image *image,
45 	struct Elf32_Sym *symbol, addr_t *symbolAddress);
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 
51 #endif	/* KERNEL_BOOT_ELF_H */
52