patch-2.1.86 linux/include/asm-sparc64/elf.h

Next file: linux/include/linux/apm_bios.h
Previous file: linux/include/asm-sparc/elf.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.85/linux/include/asm-sparc64/elf.h linux/include/asm-sparc64/elf.h
@@ -25,10 +25,6 @@
 #define ELF_DATA		ELFDATA2MSB
 #endif
 
-#ifndef ELF_FLAGS_INIT
-#define ELF_FLAGS_INIT current->tss.flags &= ~SPARC_FLAG_32BIT
-#endif
-
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
@@ -63,8 +59,13 @@
 #define ELF_PLATFORM	(NULL)
 
 #ifdef __KERNEL__
-#define SET_PERSONALITY(ibcs2)					\
+#define SET_PERSONALITY(ex, ibcs2)				\
 do {								\
+	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\
+		current->tss.flags |= SPARC_FLAG_32BIT;		\
+	else							\
+		current->tss.flags &= ~SPARC_FLAG_32BIT;	\
+								\
 	if (ibcs2)						\
 		current->personality = PER_SVR4;		\
 	else if (current->personality != PER_LINUX32)		\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov