mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
sanitize ifdefs in binfmt_aout
They are actually alpha vs. i386/arm/m68k i.e. ecoff vs. aout. In the only place where we actually tried to handle arm and i386/m68k in different ways (START_DATA() in coredump handling), the arm variant works for all of them (i386 and m68k have u.start_code set to 0). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fe30af971d
commit
17580d7f2f
1 changed files with 7 additions and 9 deletions
|
@ -95,12 +95,10 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, u
|
||||||
int has_dumped = 0;
|
int has_dumped = 0;
|
||||||
unsigned long dump_start, dump_size;
|
unsigned long dump_start, dump_size;
|
||||||
struct user dump;
|
struct user dump;
|
||||||
#if defined(__alpha__)
|
#ifdef __alpha__
|
||||||
# define START_DATA(u) (u.start_data)
|
# define START_DATA(u) (u.start_data)
|
||||||
#elif defined(__arm__)
|
#else
|
||||||
# define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code)
|
# define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code)
|
||||||
#elif defined(__i386__) || defined(__mc68000__) || defined(__arch_um__)
|
|
||||||
# define START_DATA(u) (u.u_tsize << PAGE_SHIFT)
|
|
||||||
#endif
|
#endif
|
||||||
# define START_STACK(u) (u.start_stack)
|
# define START_STACK(u) (u.start_stack)
|
||||||
|
|
||||||
|
@ -176,18 +174,18 @@ static unsigned long __user *create_aout_tables(char __user *p, struct linux_bin
|
||||||
put_user(0, --sp);
|
put_user(0, --sp);
|
||||||
if (bprm->loader) {
|
if (bprm->loader) {
|
||||||
put_user(0, --sp);
|
put_user(0, --sp);
|
||||||
put_user(0x3eb, --sp);
|
put_user(1003, --sp);
|
||||||
put_user(bprm->loader, --sp);
|
put_user(bprm->loader, --sp);
|
||||||
put_user(0x3ea, --sp);
|
put_user(1002, --sp);
|
||||||
}
|
}
|
||||||
put_user(bprm->exec, --sp);
|
put_user(bprm->exec, --sp);
|
||||||
put_user(0x3e9, --sp);
|
put_user(1001, --sp);
|
||||||
#endif
|
#endif
|
||||||
sp -= envc+1;
|
sp -= envc+1;
|
||||||
envp = (char __user * __user *) sp;
|
envp = (char __user * __user *) sp;
|
||||||
sp -= argc+1;
|
sp -= argc+1;
|
||||||
argv = (char __user * __user *) sp;
|
argv = (char __user * __user *) sp;
|
||||||
#if defined(__i386__) || defined(__mc68000__) || defined(__arm__) || defined(__arch_um__)
|
#ifndef __alpha__
|
||||||
put_user((unsigned long) envp,--sp);
|
put_user((unsigned long) envp,--sp);
|
||||||
put_user((unsigned long) argv,--sp);
|
put_user((unsigned long) argv,--sp);
|
||||||
#endif
|
#endif
|
||||||
|
@ -260,7 +258,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* OK, This is the point of no return */
|
/* OK, This is the point of no return */
|
||||||
#if defined(__alpha__)
|
#ifdef __alpha__
|
||||||
SET_AOUT_PERSONALITY(bprm, ex);
|
SET_AOUT_PERSONALITY(bprm, ex);
|
||||||
#else
|
#else
|
||||||
set_personality(PER_LINUX);
|
set_personality(PER_LINUX);
|
||||||
|
|
Loading…
Reference in a new issue