diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2003-06-24 22:45:34 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2003-06-24 22:45:34 +0000 |
commit | dd8eccf37911c51bb235e0ad7d25c02751b60d48 (patch) | |
tree | 7590edabc47b149518074fee40008c1d79f953fe /sys/arch/i386 | |
parent | 817ecac2e2ca954de96eab1d2a48544a1d6f8524 (diff) |
a.out emulation for dynamic binaries: intercept the right system calls
so that they look in /emul/a.out first. This allows a.out's ld.so to
find its own libraries without interfering with ELF at all.
Many comments from various people. okay deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/i386/conf/files.i386 | 5 | ||||
-rw-r--r-- | sys/arch/i386/i386/trap.c | 8 |
3 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index 46fb6586c3c..c19fb519102 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.343 2003/06/08 00:42:23 miod Exp $ +# $OpenBSD: GENERIC,v 1.344 2003/06/24 22:45:33 espie Exp $ # $NetBSD: GENERIC,v 1.48 1996/05/20 18:17:23 mrg Exp $ # # GENERIC -- everything that's currently supported @@ -30,6 +30,7 @@ option COMPAT_IBCS2 # binary compatibility with SCO and ISC option COMPAT_LINUX # binary compatibility with Linux option COMPAT_FREEBSD # binary compatibility with FreeBSD option COMPAT_BSDOS # binary compatibility with BSD/OS +option COMPAT_AOUT # a.out binaries are emulated #option NTFS # Experimental NTFS support diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386 index bd9c620e6fb..0d7002baf43 100644 --- a/sys/arch/i386/conf/files.i386 +++ b/sys/arch/i386/conf/files.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: files.i386,v 1.104 2003/05/14 22:53:59 tedu Exp $ +# $OpenBSD: files.i386,v 1.105 2003/06/24 22:45:33 espie Exp $ # $NetBSD: files.i386,v 1.73 1996/05/07 00:58:36 thorpej Exp $ # # new style config file for i386 architecture @@ -223,6 +223,9 @@ file arch/i386/isa/joy_isapnp.c joy_isapnp # VM86 mode file arch/i386/i386/vm86.c vm86 +# a.out binary compatibility (COMPAT_AOUT) +include "../../../compat/aout/files.aout" + # SVR4 binary compatibility (COMPAT_SVR4) include "../../../compat/svr4/files.svr4" file arch/i386/i386/svr4_machdep.c compat_svr4 diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index e0ed74e9708..16b63c1ad1e 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.58 2003/06/02 23:27:47 millert Exp $ */ +/* $OpenBSD: trap.c,v 1.59 2003/06/24 22:45:33 espie Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -87,6 +87,9 @@ extern struct emul emul_aout_freebsd, emul_elf_freebsd; #ifdef COMPAT_BSDOS extern struct emul emul_bsdos; #endif +#ifdef COMPAT_AOUT +extern struct emul emul_aout; +#endif #include "npx.h" @@ -644,6 +647,9 @@ syscall(frame) && p->p_emul != &emul_aout_freebsd && p->p_emul != &emul_elf_freebsd #endif +#ifdef COMPAT_AOUT + && p->p_emul != &emul_aout +#endif #ifdef COMPAT_BSDOS && p->p_emul != &emul_bsdos #endif |