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.
12 #include <os/kernel/elf.h>
14 #include <SupportDefs.h>
19 // Determine the correct ELF types to use for the architecture
22 # define _ELF_TYPE(type) Elf64_##type
24 # define _ELF_TYPE(type) Elf32_##type
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
49 typedef uint16 elf_versym
;
52 # define ELF_CLASS ELFCLASS64
54 # define ELF_CLASS ELFCLASS32
58 #endif /* _ELF_PRIVATE_H_ */