patch-2.4.22 linux-2.4.22/include/asm-mips64/elf.h

Next file: linux-2.4.22/include/asm-mips64/fcntl.h
Previous file: linux-2.4.22/include/asm-mips64/dma.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-mips64/elf.h linux-2.4.22/include/asm-mips64/elf.h
@@ -43,8 +43,7 @@
 									\
 	if (__h->e_machine != EM_MIPS)					\
 		__res = 0;						\
-	if ((__h->e_ident[EI_CLASS] == ELFCLASS32) &&			\
-	    ((__h->e_flags & EF_MIPS_ABI2) == 0))			\
+	if (__h->e_ident[EI_CLASS] == ELFCLASS32) 			\
 		__res = 0;						\
 									\
 	__res;								\
@@ -110,10 +109,15 @@
 
 #ifdef __KERNEL__
 #define SET_PERSONALITY(ex, ibcs2)			\
-do {	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)	\
-		current->thread.mflags |= MF_32BIT;	\
-	else						\
-		current->thread.mflags &= ~MF_32BIT;	\
+do {	current->thread.mflags &= ~MF_ABI_MASK;		\
+	if ((ex).e_ident[EI_CLASS] == ELFCLASS32) {	\
+		if ((((ex).e_flags & EF_MIPS_ABI2) != 0) &&	\
+		     ((ex).e_flags & EF_MIPS_ABI) == 0)		\
+			current->thread.mflags |= MF_N32;	\
+		else						\
+			current->thread.mflags |= MF_O32;	\
+	} else						\
+		current->thread.mflags |= MF_N64;	\
 	if (ibcs2)					\
 		set_personality(PER_SVR4);		\
 	else if (current->personality != PER_LINUX32)	\

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)