diff options
author | Roland McGrath <roland@gnu.org> | 1999-07-10 23:01:50 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-07-10 23:01:50 +0000 |
commit | 95b6c41fba934f64b399ec2f7e583c9dddcf7237 (patch) | |
tree | a826e5a155471925df58332362b84515126c08d8 /exec | |
parent | 835b2dd76d875f25eeedeffc6476bc74d51f5866 (diff) |
1999-07-10 Roland McGrath <roland@baalperazim.frob.com>
* exec.c (check_elf): Call elf_machine_matches_host instead of
comparing against elf_machine.
(load_section): #if 0 out no-op code that uses elf_machine.
* priv.h (elf_machine_matches_host): Declare it.
(elf_machine, mach_host_elf_machine): Remove decls.
* main.c (main) [!BFD]: Don't call mach_host_elf_machine.
(elf_machine): Variable removed.
* exec.c (map): Don't cast arg to munmap to vm_address_t.
Diffstat (limited to 'exec')
-rw-r--r-- | exec/exec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/exec/exec.c b/exec/exec.c index cbe202c7..6cfb8a70 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -179,6 +179,7 @@ load_section (void *section, struct execdata *u) if (! anywhere) addr += u->info.elf.loadbase; else +#if 0 switch (elf_machine) { case EM_386: @@ -193,6 +194,7 @@ load_section (void *section, struct execdata *u) default: break; } +#endif if (anywhere && addr < vm_page_size) addr = vm_page_size; } @@ -469,7 +471,7 @@ map (struct execdata *e, off_t posn, size_t len) { /* Deallocate the old mapping area. */ if (f->__buffer != NULL) - munmap ((vm_address_t) f->__buffer, f->__bufsize); + munmap (f->__buffer, f->__bufsize); f->__buffer = NULL; /* Make sure our mapping is page-aligned in the file. */ @@ -720,13 +722,15 @@ check_elf (struct execdata *e) ehdr->e_ident[EI_DATA] != host_ELFDATA || ehdr->e_ident[EI_VERSION] != EV_CURRENT || ehdr->e_version != EV_CURRENT || - ehdr->e_machine != elf_machine || ehdr->e_ehsize < sizeof *ehdr || ehdr->e_phentsize != sizeof (Elf32_Phdr)) { e->error = ENOEXEC; return; } + e->error = elf_machine_matches_host (ehdr->e_machine); + if (e->error) + return; /* Extract all this information now, while EHDR is mapped. The `map' call below for the phdrs may reuse the mapping window. */ |