Module Name:    src
Committed By:   maxv
Date:           Sat Jul 29 10:39:48 UTC 2017

Modified Files:
        src/sys/compat/freebsd: files.freebsd freebsd_exec.h freebsd_mod.c
        src/sys/modules/compat_freebsd: Makefile
Removed Files:
        src/sys/compat/freebsd: freebsd_exec_aout.c

Log Message:
Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/freebsd/files.freebsd
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/freebsd/freebsd_exec.h
cvs rdiff -u -r1.9 -r0 src/sys/compat/freebsd/freebsd_exec_aout.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/freebsd/freebsd_mod.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/compat_freebsd/Makefile

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

Modified files:

Index: src/sys/compat/freebsd/files.freebsd
diff -u src/sys/compat/freebsd/files.freebsd:1.13 src/sys/compat/freebsd/files.freebsd:1.14
--- src/sys/compat/freebsd/files.freebsd:1.13	Mon Nov 17 01:01:57 2014
+++ src/sys/compat/freebsd/files.freebsd	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.freebsd,v 1.13 2014/11/17 01:01:57 uebayasi Exp $
+#	$NetBSD: files.freebsd,v 1.14 2017/07/29 10:39:48 maxv Exp $
 #
 # Config file description for machine-independent FreeBSD compat code.
 # Included by ports that need it.
@@ -9,7 +9,6 @@
 define	compat_freebsd
 file	compat/freebsd/freebsd_exec.c		compat_freebsd
 file	compat/freebsd/freebsd_exec_elf32.c	compat_freebsd & exec_elf32
-file	compat/freebsd/freebsd_exec_aout.c	compat_freebsd & exec_aout
 file	compat/freebsd/freebsd_file.c		compat_freebsd
 file	compat/freebsd/freebsd_fork.c		compat_freebsd
 file	compat/freebsd/freebsd_ioctl.c		compat_freebsd

Index: src/sys/compat/freebsd/freebsd_exec.h
diff -u src/sys/compat/freebsd/freebsd_exec.h:1.17 src/sys/compat/freebsd/freebsd_exec.h:1.18
--- src/sys/compat/freebsd/freebsd_exec.h:1.17	Thu Dec 10 14:13:53 2009
+++ src/sys/compat/freebsd/freebsd_exec.h	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_exec.h,v 1.17 2009/12/10 14:13:53 matt Exp $	*/
+/*	$NetBSD: freebsd_exec.h,v 1.18 2017/07/29 10:39:48 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -29,72 +29,11 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
- *	from: imgact_aout.h,v 1.2 1994/12/30 08:06:19 bde Exp
  */
 
 #ifndef	_FREEBSD_EXEC_H
 #define	_FREEBSD_EXEC_H
 
-#ifdef EXEC_AOUT
-#define FREEBSD_N_GETMAGIC(ex) \
-	( (ex).a_midmag & 0xffff )
-#define FREEBSD_N_GETMID(ex) \
-	( ((ex).a_midmag >> 16) & 0x03ff )
-#define FREEBSD_N_GETFLAG(ex) \
-	( ((ex).a_midmag >> 26) & 0x3f )
-#define FREEBSD_N_SETMAGIC(ex,mag,mid,flag) \
-	( (ex).a_midmag = (((flag) & 0x3f) <<26) | (((mid) & 0x03ff) << 16) | \
-	((mag) & 0xffff) )
-
-#define FREEBSD_N_ALIGN(ex,x) \
-	(FREEBSD_N_GETMAGIC(ex) == ZMAGIC || \
-	 FREEBSD_N_GETMAGIC(ex) == QMAGIC ? \
-	 ((x) + FREEBSD___LDPGSZ - 1) & \
-	 ~(unsigned long)(FREEBSD___LDPGSZ - 1) : (x))
-
-/* Valid magic number check. */
-#define	FREEBSD_N_BADMAG(ex) \
-	(FREEBSD_N_GETMAGIC(ex) != OMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != NMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != ZMAGIC && \
-	 FREEBSD_N_GETMAGIC(ex) != QMAGIC)
-
-/* Address of the bottom of the text segment. */
-#define FREEBSD_N_TXTADDR(ex) \
-	((FREEBSD_N_GETMAGIC(ex) == OMAGIC || \
-	  FREEBSD_N_GETMAGIC(ex) == NMAGIC || \
-	  FREEBSD_N_GETMAGIC(ex) == ZMAGIC) ? 0 : AOUT_LDPGSZ)
-
-/* Address of the bottom of the data segment. */
-#define FREEBSD_N_DATADDR(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_TXTADDR(ex) + (ex).a_text)
-
-/* Text segment offset. */
-#define	FREEBSD_N_TXTOFF(ex) \
-	(FREEBSD_N_GETMAGIC(ex) == ZMAGIC ? AOUT_LDPGSZ : \
-	 FREEBSD_N_GETMAGIC(ex) == QMAGIC ? 0 : sizeof(struct exec))
-
-/* Data segment offset. */
-#define	FREEBSD_N_DATOFF(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_TXTOFF(ex) + (ex).a_text)
-
-/* Relocation table offset. */
-#define FREEBSD_N_RELOFF(ex) \
-	FREEBSD_N_ALIGN(ex, FREEBSD_N_DATOFF(ex) + (ex).a_data)
-
-/* Symbol table offset. */
-#define FREEBSD_N_SYMOFF(ex) \
-	(FREEBSD_N_RELOFF(ex) + (ex).a_trsize + (ex).a_drsize)
-
-/* String table offset. */
-#define	FREEBSD_N_STROFF(ex) 	(FREEBSD_N_SYMOFF(ex) + (ex).a_syms)
-
-#define	FREEBSD_AOUT_HDR_SIZE	sizeof(struct exec)
-
-int exec_freebsd_aout_makecmds(struct lwp *, struct exec_package *);
-
-#endif /* EXEC_AOUT */
-
 #ifdef EXEC_ELF32
 #define FREEBSD_ELF_BRAND_STRING "FreeBSD"
 #define FREEBSD_ELF_INTERP_PREFIX_STRING "/usr/libexec/ld-elf.so"

Index: src/sys/compat/freebsd/freebsd_mod.c
diff -u src/sys/compat/freebsd/freebsd_mod.c:1.5 src/sys/compat/freebsd/freebsd_mod.c:1.6
--- src/sys/compat/freebsd/freebsd_mod.c:1.5	Fri Mar  7 02:02:16 2014
+++ src/sys/compat/freebsd/freebsd_mod.c	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_mod.c,v 1.5 2014/03/07 02:02:16 christos Exp $	*/
+/*	$NetBSD: freebsd_mod.c,v 1.6 2017/07/29 10:39:48 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_mod.c,v 1.5 2014/03/07 02:02:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_mod.c,v 1.6 2017/07/29 10:39:48 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -40,7 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_mod.
 #include <sys/module.h>
 #include <sys/exec.h>
 #include <sys/exec_elf.h>
-#include <sys/exec_aout.h>
 #include <sys/signalvar.h>
 
 #include <compat/freebsd/freebsd_exec.h>
@@ -51,16 +50,11 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_mod.
 #else
 # define	MD1	""
 #endif
-#if defined(EXEC_AOUT)
-#  define	MD2	",exec_aout"
-#else
-# define	MD2	""
-#endif
 
 #define ELF32_AUXSIZE (howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), \
     sizeof(Elf32_Addr)) + MAXPATHLEN + ALIGN(1))
 
-MODULE(MODULE_CLASS_EXEC, compat_freebsd, "compat,compat_ossaudio" MD1 MD2);
+MODULE(MODULE_CLASS_EXEC, compat_freebsd, "compat,compat_ossaudio" MD1);
 
 static struct execsw freebsd_execsw[] = {
 #ifdef EXEC_ELF32
@@ -80,23 +74,6 @@ static struct execsw freebsd_execsw[] = 
 		.es_setup_stack = exec_setup_stack,
 	},
 #endif
-#ifdef EXEC_AOUT
-	/* FreeBSD a.out (native word size) */
-	{
-		.es_hdrsz = FREEBSD_AOUT_HDR_SIZE,
-		.es_makecmds = exec_freebsd_aout_makecmds,
-		.u = {
-			.elf_probe_func = NULL,
-		},
-		.es_emul = &emul_freebsd,
-		.es_prio = EXECSW_PRIO_ANY,
-		.es_arglen = 0,
-		.es_copyargs = copyargs,
-		.es_setregs = NULL,
-		.es_coredump = coredump_netbsd,
-		.es_setup_stack = exec_setup_stack,
-	},
-#endif
 };
 
 static int

Index: src/sys/modules/compat_freebsd/Makefile
diff -u src/sys/modules/compat_freebsd/Makefile:1.3 src/sys/modules/compat_freebsd/Makefile:1.4
--- src/sys/modules/compat_freebsd/Makefile:1.3	Sat Feb 14 13:56:41 2009
+++ src/sys/modules/compat_freebsd/Makefile	Sat Jul 29 10:39:48 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2009/02/14 13:56:41 abs Exp $
+#	$NetBSD: Makefile,v 1.4 2017/07/29 10:39:48 maxv Exp $
 
 .include "../Makefile.inc"
 .include "../Makefile.assym"
@@ -10,13 +10,13 @@ CPPFLAGS+=	-DCOMPAT_FREEBSD
 
 .PATH:	${S}/compat/freebsd
 
-SRCS+=	freebsd_exec.c freebsd_exec_aout.c freebsd_exec_elf32.c
+SRCS+=	freebsd_exec.c freebsd_exec_elf32.c
 SRCS+=	freebsd_file.c freebsd_fork.c freebsd_ioctl.c freebsd_ipc.c
 SRCS+=	freebsd_misc.c freebsd_ptrace.c freebsd_sched.c freebsd_syscalls.c
 SRCS+=	freebsd_sysctl.c freebsd_sysent.c freebsd_mod.c
 
 .if ${MACHINE_ARCH} == "i386"
-CPPFLAGS+=	-DEXEC_ELF32 -DEXEC_AOUT
+CPPFLAGS+=	-DEXEC_ELF32
 .PATH:	${S}/arch/i386/i386
 SRCS+=	freebsd_machdep.c freebsd_syscall.c freebsd_sigcode.S
 .endif

Reply via email to