vfs: check userland buffers before reading them.
[haiku.git] / headers / private / system / elf_private.h
blob78da6ffcd4336e404752cd14da7062139b156364
1 /*
2 * Copyright 2002-2016 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
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
12 #include <os/kernel/elf.h>
14 #include <SupportDefs.h>
16 #include <arch_elf.h>
19 // Determine the correct ELF types to use for the architecture
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
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);
46 #undef DEFINE_ELF_TYPE
47 #undef _ELF_TYPE
49 typedef uint16 elf_versym;
51 #if B_HAIKU_64_BIT
52 # define ELF_CLASS ELFCLASS64
53 #else
54 # define ELF_CLASS ELFCLASS32
55 #endif
58 #endif /* _ELF_PRIVATE_H_ */