Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern fix fat binary architecture choosing code. mach bin...



details:   https://anonhg.NetBSD.org/src/rev/af195fbda3eb
branches:  trunk
changeset: 538803:af195fbda3eb
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 30 15:21:01 2002 +0000

description:
fix fat binary architecture choosing code. mach binaries now execute as
poorly as before the x86 MP merge.

diffstat:

 sys/kern/exec_macho.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 7b19232b20e5 -r af195fbda3eb sys/kern/exec_macho.c
--- a/sys/kern/exec_macho.c     Wed Oct 30 15:04:47 2002 +0000
+++ b/sys/kern/exec_macho.c     Wed Oct 30 15:21:01 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_macho.c,v 1.11 2002/10/30 15:04:47 christos Exp $ */
+/*     $NetBSD: exec_macho.c,v 1.12 2002/10/30 15:21:01 christos Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_macho.c,v 1.11 2002/10/30 15:04:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_macho.c,v 1.12 2002/10/30 15:21:01 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -351,7 +351,7 @@
        int error = ENOEXEC, i;
        size_t size;
        void *buf = &lc;
-       u_int32_t *sc;
+       u_int32_t *sc = NULL;
 
 #ifdef DEBUG_MACHO
        exec_macho_print_fat_header(fat);
@@ -369,10 +369,11 @@
                        for (sc = exec_macho_supported_cpu; *sc; sc++)
                                if (*sc == be32toh(arch.cputype))
                                        break;
-                       if (*sc == NULL) {
-                               DPRINTF(("CPU not supported by this binary"));
-                               goto bad;
-                       }
+               }
+               if (sc == NULL || *sc == 0) {
+                       DPRINTF(("CPU %d not supported by this binary",
+                               be32toh(arch.cputype)));
+                       goto bad;
                }
                break;
 



Home | Main Index | Thread Index | Old Index