Commit b14a4258 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Add a.out support for x86-64

From: Andi Kleen <ak@muc.de>

Add 32bit a.out support for x86-64.

Not exactly an important bug fix, but maybe it will help someone.  This
should increase the current 98% compatibility to i386 to perhaps 98.1% @)

I tested an old a.out SuSE 4.2 installation in chroot and it worked.  It
also ran some very old linux binaries from '92 found on ftp.funet.fi.  The
only program that didn't was the SuSE a.out GNU emacs, but I was too lazy
to track that down.  Core dumps are not supported.
parent dce80777
......@@ -371,6 +371,12 @@ config IA32_EMULATION
turn this on, unless you're 100% sure that you don't have any 32-bit programs
left.
config IA32_AOUT
bool "IA32 a.out support"
depends on IA32_EMULATION
help
Support old a.out binaries in the 32bit emulation.
config COMPAT
bool
depends on IA32_EMULATION
......
......@@ -6,6 +6,8 @@ obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \
ia32_signal.o tls32.o \
ia32_binfmt.o fpu32.o ptrace32.o ipc32.o syscall32.o
obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
$(obj)/syscall32.o: $(src)/syscall32.c $(obj)/vsyscall.so
# Teach kbuild about targets
......
This diff is collapsed.
......@@ -221,7 +221,7 @@ ia32_sys_call_table:
.quad sys_chmod /* 15 */
.quad sys_lchown16
.quad ni_syscall /* old break syscall holder */
.quad ni_syscall /* (old)stat */
.quad sys_stat
.quad sys32_lseek
.quad sys_getpid /* 20 */
.quad sys_mount /* mount */
......@@ -231,7 +231,7 @@ ia32_sys_call_table:
.quad sys_stime /* stime */ /* 25 */
.quad sys32_ptrace /* ptrace */
.quad sys_alarm /* XXX sign extension??? */
.quad ni_syscall /* (old)fstat */
.quad sys_fstat /* (old)fstat */
.quad sys_pause
.quad compat_sys_utime /* 30 */
.quad ni_syscall /* old stty syscall holder */
......@@ -287,7 +287,7 @@ ia32_sys_call_table:
.quad sys_setgroups16
.quad sys32_old_select
.quad sys_symlink
.quad ni_syscall /* (old)lstat */
.quad sys_lstat
.quad sys_readlink /* 85 */
.quad sys_uselib
.quad sys_swapon
......
......@@ -106,7 +106,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
EXPORT_SYMBOL(vfs_fstat);
#if !defined(__alpha__) && !defined(__sparc__) && !defined(__ia64__) \
&& !defined(CONFIG_ARCH_S390) && !defined(__hppa__) && !defined(__x86_64__) \
&& !defined(CONFIG_ARCH_S390) && !defined(__hppa__) \
&& !defined(__arm__) && !defined(CONFIG_V850) && !defined(__powerpc64__)
/*
......
#ifndef __X8664_A_OUT_H__
#define __X8664_A_OUT_H__
/* Note: a.out is not supported in 64bit mode. This is just here to
still let some old things compile. */
/* 32bit a.out */
struct exec
{
unsigned long a_info; /* Use macros N_MAGIC, etc for access */
unsigned int a_info; /* Use macros N_MAGIC, etc for access */
unsigned a_text; /* length of text, in bytes */
unsigned a_data; /* length of data, in bytes */
unsigned a_bss; /* length of uninitialized data area for file, in bytes */
......@@ -23,7 +21,7 @@ struct exec
#ifdef __KERNEL__
#define STACK_TOP TASK_SIZE
#define STACK_TOP 0xc0000000
#endif
......
......@@ -26,4 +26,19 @@ struct stat {
long __unused[3];
};
/* For 32bit emulation */
struct __old_kernel_stat {
unsigned short st_dev;
unsigned short st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short st_gid;
unsigned short st_rdev;
unsigned int st_size;
unsigned int st_atime;
unsigned int st_mtime;
unsigned int st_ctime;
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment