xref: /haiku/headers/private/system/elf_private.h (revision 4bd0c1066b227cec4b79883bdef697c7a27f2e90)
1 /*
2  * Copyright 2002-2016 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001 Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef _ELF_PRIVATE_H
9 #define _ELF_PRIVATE_H
10 
11 
12 #include <os/kernel/elf.h>
13 
14 #include <SupportDefs.h>
15 
16 #include <arch_elf.h>
17 
18 
19 // Determine the correct ELF types to use for the architecture
20 
21 #if B_HAIKU_64_BIT
22 #	define _ELF_TYPE(type)	Elf64_##type
23 #else
24 #	define _ELF_TYPE(type)	Elf32_##type
25 #endif
26 #define DEFINE_ELF_TYPE(type, name) \
27 	typedef _ELF_TYPE(type) name
28 
29 DEFINE_ELF_TYPE(Ehdr, elf_ehdr);
30 DEFINE_ELF_TYPE(Phdr, elf_phdr);
31 DEFINE_ELF_TYPE(Shdr, elf_shdr);
32 DEFINE_ELF_TYPE(Sym, elf_sym);
33 DEFINE_ELF_TYPE(Dyn, elf_dyn);
34 DEFINE_ELF_TYPE(Rel, elf_rel);
35 DEFINE_ELF_TYPE(Rela, elf_rela);
36 DEFINE_ELF_TYPE(Verdef, elf_verdef);
37 DEFINE_ELF_TYPE(Verdaux, elf_verdaux);
38 DEFINE_ELF_TYPE(Verneed, elf_verneed);
39 DEFINE_ELF_TYPE(Vernaux, elf_vernaux);
40 DEFINE_ELF_TYPE(Nhdr, elf_nhdr);
41 DEFINE_ELF_TYPE(Note_Team, elf_note_team);
42 DEFINE_ELF_TYPE(Note_Area_Entry, elf_note_area_entry);
43 DEFINE_ELF_TYPE(Note_Image_Entry, elf_note_image_entry);
44 DEFINE_ELF_TYPE(Note_Thread_Entry, elf_note_thread_entry);
45 
46 #undef DEFINE_ELF_TYPE
47 #undef _ELF_TYPE
48 
49 typedef uint16 elf_versym;
50 
51 #if B_HAIKU_64_BIT
52 #	define ELF_CLASS	ELFCLASS64
53 #else
54 #	define ELF_CLASS	ELFCLASS32
55 #endif
56 
57 
58 #endif	/* _ELF_PRIVATE_H_ */
59