Module Name:    src
Committed By:   tsutsui
Date:           Sun Jan 16 09:50:45 UTC 2011

Modified Files:
        src/sys/arch/mips/mips: cpu_exec.c

Log Message:
Make pre-2.0 ELF binaries (with gcc-2.95.3/binutils-2.11.2) actually work
with options COMPAT_16.
Tested on R3000 pmax and R5000 sgimips, closes PR port-mips/44375.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mips/mips/cpu_exec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.59 src/sys/arch/mips/mips/cpu_exec.c:1.60
--- src/sys/arch/mips/mips/cpu_exec.c:1.59	Mon Dec 14 04:09:38 2009
+++ src/sys/arch/mips/mips/cpu_exec.c	Sun Jan 16 09:50:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.59 2009/12/14 04:09:38 mrg Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.60 2011/01/16 09:50:44 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.59 2009/12/14 04:09:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.60 2011/01/16 09:50:44 tsutsui Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_ultrix.h"
@@ -291,12 +291,14 @@
 			printf("pid %d(%s): ABI set to N32 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
 		break;
 #endif
-	case EF_MIPS_ABI_O32:
-		itp_suffix = "o32";
-		p->p_md.md_abi = _MIPS_BSD_API_O32;
 #ifdef COMPAT_16
+	case 0:
 		*start_p = ELF32_LINK_ADDR;
+		/* FALLTHROUGH */
 #endif
+	case EF_MIPS_ABI_O32:
+		itp_suffix = "o32";
+		p->p_md.md_abi = _MIPS_BSD_API_O32;
 		if (old_abi != p->p_md.md_abi)
 			printf("pid %d(%s): ABI set to O32 (e_flags=%#x)\n", p->p_pid, p->p_comm, eh->e_flags);
 		break;

Reply via email to