diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2009-01-03 02:16:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-03 14:45:54 -0500 |
commit | 17580d7f2f632ff8c9786d609508c35c9f56e1f3 (patch) | |
tree | 488abddb16d4640f4c27fdcf2c36186c6b70bdcc /fs/binfmt_aout.c | |
parent | fe30af971d896c144ef4708f97cf9d3186303c42 (diff) |
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>
Diffstat (limited to 'fs/binfmt_aout.c')
-rw-r--r-- | fs/binfmt_aout.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 8a3b32f5b781..b639dcf7c778 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -95,12 +95,10 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, u | |||
95 | int has_dumped = 0; | 95 | int has_dumped = 0; |
96 | unsigned long dump_start, dump_size; | 96 | unsigned long dump_start, dump_size; |
97 | struct user dump; | 97 | struct user dump; |
98 | #if defined(__alpha__) | 98 | #ifdef __alpha__ |
99 | # define START_DATA(u) (u.start_data) | 99 | # define START_DATA(u) (u.start_data) |
100 | #elif defined(__arm__) | 100 | #else |
101 | # define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code) | 101 | # define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code) |
102 | #elif defined(__i386__) || defined(__mc68000__) || defined(__arch_um__) | ||
103 | # define START_DATA(u) (u.u_tsize << PAGE_SHIFT) | ||
104 | #endif | 102 | #endif |
105 | # define START_STACK(u) (u.start_stack) | 103 | # define START_STACK(u) (u.start_stack) |
106 | 104 | ||
@@ -176,18 +174,18 @@ static unsigned long __user *create_aout_tables(char __user *p, struct linux_bin | |||
176 | put_user(0, --sp); | 174 | put_user(0, --sp); |
177 | if (bprm->loader) { | 175 | if (bprm->loader) { |
178 | put_user(0, --sp); | 176 | put_user(0, --sp); |
179 | put_user(0x3eb, --sp); | 177 | put_user(1003, --sp); |
180 | put_user(bprm->loader, --sp); | 178 | put_user(bprm->loader, --sp); |
181 | put_user(0x3ea, --sp); | 179 | put_user(1002, --sp); |
182 | } | 180 | } |
183 | put_user(bprm->exec, --sp); | 181 | put_user(bprm->exec, --sp); |
184 | put_user(0x3e9, --sp); | 182 | put_user(1001, --sp); |
185 | #endif | 183 | #endif |
186 | sp -= envc+1; | 184 | sp -= envc+1; |
187 | envp = (char __user * __user *) sp; | 185 | envp = (char __user * __user *) sp; |
188 | sp -= argc+1; | 186 | sp -= argc+1; |
189 | argv = (char __user * __user *) sp; | 187 | argv = (char __user * __user *) sp; |
190 | #if defined(__i386__) || defined(__mc68000__) || defined(__arm__) || defined(__arch_um__) | 188 | #ifndef __alpha__ |
191 | put_user((unsigned long) envp,--sp); | 189 | put_user((unsigned long) envp,--sp); |
192 | put_user((unsigned long) argv,--sp); | 190 | put_user((unsigned long) argv,--sp); |
193 | #endif | 191 | #endif |
@@ -260,7 +258,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
260 | return retval; | 258 | return retval; |
261 | 259 | ||
262 | /* OK, This is the point of no return */ | 260 | /* OK, This is the point of no return */ |
263 | #if defined(__alpha__) | 261 | #ifdef __alpha__ |
264 | SET_AOUT_PERSONALITY(bprm, ex); | 262 | SET_AOUT_PERSONALITY(bprm, ex); |
265 | #else | 263 | #else |
266 | set_personality(PER_LINUX); | 264 | set_personality(PER_LINUX); |