patch-2.4.22 linux-2.4.22/include/asm-arm/proc-armv/elf.h

Next file: linux-2.4.22/include/asm-arm/proc-armv/locks.h
Previous file: linux-2.4.22/include/asm-arm/proc-armv/cache.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-arm/proc-armv/elf.h linux-2.4.22/include/asm-arm/proc-armv/elf.h
@@ -6,10 +6,14 @@
 
 #ifdef __KERNEL__
 
-/* 32-bit code is always OK.  Some cpus can do 26-bit, some can't.  */
-#define ELF_PROC_OK(x)				\
-	((! ((x)->e_flags & EF_ARM_APCS26))	\
-	|| (elf_hwcap & HWCAP_26BIT))
+/*
+ * 32-bit code is always OK.  Some cpus can do 26-bit, some can't.
+ */
+#define ELF_PROC_OK(x) 							 \
+	(( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1)      || \
+	 (!(elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 3) == 0)      || \
+	 ( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \
+	 ((x)->e_flags & EF_ARM_APCS26) == 0)
 
 /* Old NetWinder binaries were compiled in such a way that the iBCS
    heuristic always trips on them.  Until these binaries become uncommon

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