diff options
author | Roland McGrath <roland@gnu.org> | 1995-01-15 11:31:54 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-01-15 11:31:54 +0000 |
commit | 781e1bb2a1b19e0d51396774129f4a35dba534b0 (patch) | |
tree | 6b4db2d608c0b93c59ee91ceb79eb129d7c2cfe4 /exec | |
parent | d3f67fb2b9bd074829a6ad0985207e31b88a51be (diff) |
[BFD] (bfd_mach_host_arch_mach): In decl, MACHINE arg is `long int *' now.
[BFD] (host_bfd_arch_info): New variable.
[BFD] (host_bfd): Initialize `arch_info' member to its address.
(check) [BFD]: Use bfd_arch_get_compatible properly, rather than the
nonexistent bfd_arch_compatible.
(main) [BFD]: Fill in host_bfd.arch_info instead of old `obj_machine' and
`obj_archiecture' members, which BFD no longer has.
Diffstat (limited to 'exec')
-rw-r--r-- | exec/exec.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/exec/exec.c b/exec/exec.c index d8970036..4ef9e92a 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -1,5 +1,5 @@ /* GNU Hurd standard exec server. - Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Written by Roland McGrath. #ifdef BFD @@ -59,7 +59,7 @@ bfd *bfd_openstream (FILE *); extern error_t bfd_mach_host_arch_mach (host_t host, bfd_architecture *arch, - bfd_machine *machine); + long int *machine); #else #include A_OUT_H @@ -101,8 +101,9 @@ struct execdata }; #ifdef BFD -static bfd host_bfd; /* A BFD whose architecture and machine type - reflect those of the running system. */ +/* A BFD whose architecture and machine type are those of the host system. */ +static bfd_arch_info_type host_bfd_arch_info; +static bfd host_bfd { arch_info: &host_bfd_arch_info }; #else static enum machine_type host_machine; /* a.out machine_type of the host. */ #endif @@ -698,9 +699,11 @@ check (struct execdata *e) e->error = b2he (ENOEXEC); return; } - else if (!bfd_arch_compatible (e->bfd, &host_bfd, NULL, NULL) || - !(bfd->flags & EXEC_P)) + else if (!(e->bfd->flags & EXEC_P) || + bfd_arch_get_compatible (&host_bfd, e->bfd) != host_bfd.arch_info) { + /* This file is of a recognized binary file format, but it is not + executable on this machine. */ e->error = b2he (EINVAL); return; } @@ -1805,8 +1808,8 @@ main (int argc, char **argv) /* Put the Mach kernel's idea of what flavor of machine this is into the fake BFD against which architecture compatibility checks are made. */ err = bfd_mach_host_arch_mach (mach_host_self (), - &host_bfd.obj_machine, - &host_bfd.obj_arch); + &host_bfd.arch_info->arch, + &host_bfd.arch_info->mach); #else err = aout_mach_host_machine (mach_host_self (), (int *)&host_machine); #endif |