fix dependency check logic cause config always disabled
[lunaix-os.git] / lunaix-os / arch / x86 / exec / elf32.c
1 #include <lunaix/exebi/elf.h>
2
3 #define EM_386 3
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] == ELFCLASS32 &&
12            ehdr->e_ident[EI_DATA] == ELFDATA2LSB && ehdr->e_machine == EM_386;
13 }