aboutsummaryrefslogtreecommitdiff
path: root/serverboot/elf-load.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1997-04-04 01:13:44 +0000
committerThomas Bushnell <thomas@gnu.org>1997-04-04 01:13:44 +0000
commit4355d388f51fdda4ff68935561cbe814b0f8d820 (patch)
tree3869739c3c61e99d45e3b5f61ce97659d9863f05 /serverboot/elf-load.c
parent3dd031e1f1571f5b60409c17efe90cc51d51a25c (diff)
downloadhurd-4355d388f51fdda4ff68935561cbe814b0f8d820.tar.gz
hurd-4355d388f51fdda4ff68935561cbe814b0f8d820.tar.bz2
hurd-4355d388f51fdda4ff68935561cbe814b0f8d820.zip
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.c12
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;