Commit 17580d7f2f632ff8c9786d609508c35c9f56e1f3
Committed by
Linus Torvalds
1 parent
fe30af971d
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 7 additions and 9 deletions Side-by-side Diff
fs/binfmt_aout.c
... | ... | @@ -95,12 +95,10 @@ |
95 | 95 | int has_dumped = 0; |
96 | 96 | unsigned long dump_start, dump_size; |
97 | 97 | struct user dump; |
98 | -#if defined(__alpha__) | |
98 | +#ifdef __alpha__ | |
99 | 99 | # define START_DATA(u) (u.start_data) |
100 | -#elif defined(__arm__) | |
100 | +#else | |
101 | 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 | 102 | #endif |
105 | 103 | # define START_STACK(u) (u.start_stack) |
106 | 104 | |
107 | 105 | |
108 | 106 | |
109 | 107 | |
... | ... | @@ -176,18 +174,18 @@ |
176 | 174 | put_user(0, --sp); |
177 | 175 | if (bprm->loader) { |
178 | 176 | put_user(0, --sp); |
179 | - put_user(0x3eb, --sp); | |
177 | + put_user(1003, --sp); | |
180 | 178 | put_user(bprm->loader, --sp); |
181 | - put_user(0x3ea, --sp); | |
179 | + put_user(1002, --sp); | |
182 | 180 | } |
183 | 181 | put_user(bprm->exec, --sp); |
184 | - put_user(0x3e9, --sp); | |
182 | + put_user(1001, --sp); | |
185 | 183 | #endif |
186 | 184 | sp -= envc+1; |
187 | 185 | envp = (char __user * __user *) sp; |
188 | 186 | sp -= argc+1; |
189 | 187 | argv = (char __user * __user *) sp; |
190 | -#if defined(__i386__) || defined(__mc68000__) || defined(__arm__) || defined(__arch_um__) | |
188 | +#ifndef __alpha__ | |
191 | 189 | put_user((unsigned long) envp,--sp); |
192 | 190 | put_user((unsigned long) argv,--sp); |
193 | 191 | #endif |
... | ... | @@ -260,7 +258,7 @@ |
260 | 258 | return retval; |
261 | 259 | |
262 | 260 | /* OK, This is the point of no return */ |
263 | -#if defined(__alpha__) | |
261 | +#ifdef __alpha__ | |
264 | 262 | SET_AOUT_PERSONALITY(bprm, ex); |
265 | 263 | #else |
266 | 264 | set_personality(PER_LINUX); |