diff options
author | Thomas Bushnell <thomas@gnu.org> | 1997-04-04 01:13:44 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1997-04-04 01:13:44 +0000 |
commit | 8e98bdc7a128545a0b7a8d4686f822719ac74ecb (patch) | |
tree | e33b12a4df3a3665720ce7a8fb08d41a4b6a8551 /serverboot/elf-load.c | |
parent | 2059697c29c926c3ad42efb61993baf2723f0b0e (diff) |
Thu Apr 3 20:00:58 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* elf-load.c (exec_load): Include <elf.h> instead of
<mach/exec/elf.h>. Include "mach-exec.h" instead of
<mach/exec/elf.h>.
(exec_load) [i386]: Check for i386 types directly; abandon old
MY_EI_DATA and MY_E_MACHINE.
* load.c: Include "mach-exec.h" instead of <mach/exec/elf.h>.
* exec.c: Likewise.
* mach-exec.h: New file.
Diffstat (limited to 'serverboot/elf-load.c')
-rw-r--r-- | serverboot/elf-load.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/serverboot/elf-load.c b/serverboot/elf-load.c index 1d103d3c..a30124a2 100644 --- a/serverboot/elf-load.c +++ b/serverboot/elf-load.c @@ -24,8 +24,8 @@ #include <alloca.h> #include <mach/machine/vm_types.h> -#include <mach/exec/elf.h> -#include <mach/exec/exec.h> +#include <elf.h> +#include "mach-exec.h" int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec, void *handle, exec_info_t *out_info) @@ -50,10 +50,14 @@ int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec, return EX_NOT_EXECUTABLE; /* Make sure the file is of the right architecture. */ +#ifdef i386 if ((x.e_ident[EI_CLASS] != ELFCLASS32) || - (x.e_ident[EI_DATA] != MY_EI_DATA) || - (x.e_machine != MY_E_MACHINE)) + (x.e_ident[EI_DATA] != ELFDATA2LSB) || + (x.e_machine != EM_386)) return EX_WRONG_ARCH; +#else +#error Not ported to this architecture! +#endif /* XXX others */ out_info->entry = (vm_offset_t) x.e_entry; |