diff options
Diffstat (limited to 'arch/mips/include/asm/elf.h')
-rw-r--r-- | arch/mips/include/asm/elf.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h index fd1d39eb7431..455c0ac7d4ea 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h | |||
@@ -249,7 +249,8 @@ extern struct mips_abi mips_abi_n32; | |||
249 | 249 | ||
250 | #define SET_PERSONALITY(ex) \ | 250 | #define SET_PERSONALITY(ex) \ |
251 | do { \ | 251 | do { \ |
252 | set_personality(PER_LINUX); \ | 252 | if (personality(current->personality) != PER_LINUX) \ |
253 | set_personality(PER_LINUX); \ | ||
253 | \ | 254 | \ |
254 | current->thread.abi = &mips_abi; \ | 255 | current->thread.abi = &mips_abi; \ |
255 | } while (0) | 256 | } while (0) |
@@ -296,6 +297,8 @@ do { \ | |||
296 | 297 | ||
297 | #define SET_PERSONALITY(ex) \ | 298 | #define SET_PERSONALITY(ex) \ |
298 | do { \ | 299 | do { \ |
300 | unsigned int p; \ | ||
301 | \ | ||
299 | clear_thread_flag(TIF_32BIT_REGS); \ | 302 | clear_thread_flag(TIF_32BIT_REGS); \ |
300 | clear_thread_flag(TIF_32BIT_ADDR); \ | 303 | clear_thread_flag(TIF_32BIT_ADDR); \ |
301 | \ | 304 | \ |
@@ -304,7 +307,8 @@ do { \ | |||
304 | else \ | 307 | else \ |
305 | current->thread.abi = &mips_abi; \ | 308 | current->thread.abi = &mips_abi; \ |
306 | \ | 309 | \ |
307 | if (current->personality != PER_LINUX32) \ | 310 | p = personality(current->personality); \ |
311 | if (p != PER_LINUX32 && p != PER_LINUX) \ | ||
308 | set_personality(PER_LINUX); \ | 312 | set_personality(PER_LINUX); \ |
309 | } while (0) | 313 | } while (0) |
310 | 314 | ||