Architectural Support: x86_64 (#37)
[lunaix-os.git] / lunaix-os / arch / x86 / exec / elf64.c
1 #include <lunaix/exebi/elf.h>
2
3 #define EM_X86_64 62
4
5 int
6 elf_check_arch(const struct elf* elf)
7 {
8     const struct elf_ehdr* ehdr = &elf->eheader;
9
10     return *(u32_t*)(ehdr->e_ident) == ELFMAGIC_LE &&
11            ehdr->e_ident[EI_CLASS] == ELFCLASS64 &&
12            ehdr->e_ident[EI_DATA] == ELFDATA2LSB && 
13            ehdr->e_machine == EM_X86_64;
14 }