diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-11-20 06:15:00 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-11-20 17:19:17 -0500 |
commit | 373c76d62240cd3c1a3af42440b0a73cb7296bda (patch) | |
tree | 2d42b5eb695ef1b2ead78147af26a72e6af9e5c2 /arch/powerpc | |
parent | e844b1eeae42dc93bf13e67812a95ee7b58be8c7 (diff) |
powerpc: Add TIF_ELF2ABI flag.
Little endian ppc64 is getting an exciting new ABI. This is reflected
by the bottom two bits of e_flags in the ELF header:
0 == legacy binaries (v1 ABI)
1 == binaries using the old ABI (compiled with a new toolchain)
2 == binaries using the new ABI.
We store this in a thread flag, because we need to set it in core
dumps and for signal delivery. Our chief concern is that it doesn't
use function descriptors.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/elf.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/thread_info.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index cc0655a702a7..6d0e2369fe81 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h | |||
@@ -86,6 +86,8 @@ typedef elf_vrregset_t elf_fpxregset_t; | |||
86 | #ifdef __powerpc64__ | 86 | #ifdef __powerpc64__ |
87 | # define SET_PERSONALITY(ex) \ | 87 | # define SET_PERSONALITY(ex) \ |
88 | do { \ | 88 | do { \ |
89 | if (((ex).e_flags & 0x3) == 2) \ | ||
90 | set_thread_flag(TIF_ELF2ABI); \ | ||
89 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ | 91 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ |
90 | set_thread_flag(TIF_32BIT); \ | 92 | set_thread_flag(TIF_32BIT); \ |
91 | else \ | 93 | else \ |
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index ba7b1973866e..05a3030b4582 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h | |||
@@ -107,6 +107,9 @@ static inline struct thread_info *current_thread_info(void) | |||
107 | #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation | 107 | #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation |
108 | for stack store? */ | 108 | for stack store? */ |
109 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ | 109 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ |
110 | #if defined(CONFIG_PPC64) | ||
111 | #define TIF_ELF2ABI 18 /* function descriptors must die! */ | ||
112 | #endif | ||
110 | 113 | ||
111 | /* as above, but as bit values */ | 114 | /* as above, but as bit values */ |
112 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 115 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
@@ -185,6 +188,12 @@ static inline bool test_thread_local_flags(unsigned int flags) | |||
185 | #define is_32bit_task() (1) | 188 | #define is_32bit_task() (1) |
186 | #endif | 189 | #endif |
187 | 190 | ||
191 | #if defined(CONFIG_PPC64) | ||
192 | #define is_elf2_task() (test_thread_flag(TIF_ELF2ABI)) | ||
193 | #else | ||
194 | #define is_elf2_task() (0) | ||
195 | #endif | ||
196 | |||
188 | #endif /* !__ASSEMBLY__ */ | 197 | #endif /* !__ASSEMBLY__ */ |
189 | 198 | ||
190 | #endif /* __KERNEL__ */ | 199 | #endif /* __KERNEL__ */ |