summaryrefslogtreecommitdiff
path: root/serverboot
diff options
context:
space:
mode:
Diffstat (limited to 'serverboot')
-rw-r--r--serverboot/elf-load.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/serverboot/elf-load.c b/serverboot/elf-load.c
index 5de838c3..603eadf0 100644
--- a/serverboot/elf-load.c
+++ b/serverboot/elf-load.c
@@ -61,8 +61,7 @@ int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec,
#endif
if ((x.h.e_ident[EI_CLASS] != MY_CLASS) ||
- (x.h.e_ident[EI_DATA] != MY_DATA) ||
- (x.h.e_machine != MY_MACHINE))
+ (x.h.e_ident[EI_DATA] != MY_DATA))
return EX_WRONG_ARCH;
if (MY_CLASS == ELFCLASS64)
@@ -70,6 +69,9 @@ int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec,
Elf64_Phdr *phdr, *ph;
vm_size_t phsize;
+ if (x.h64.e_machine != MY_MACHINE)
+ return EX_WRONG_ARCH;
+
/* XXX others */
out_info->entry = (vm_offset_t) x.h64.e_entry;
out_info->init_dp = 0; /* ? */
@@ -104,6 +106,9 @@ int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec,
Elf32_Phdr *phdr, *ph;
vm_size_t phsize;
+ if (x.h.e_machine != MY_MACHINE)
+ return EX_WRONG_ARCH;
+
/* XXX others */
out_info->entry = (vm_offset_t) x.h.e_entry;
out_info->init_dp = 0; /* ? */