aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2011-02-15 17:04:19 +0000
committerDave Martin <dave.martin@linaro.org>2011-02-23 12:30:38 +0000
commit4760195df00982b4e388e859b41a63feed6d0cab (patch)
tree50fb5ee861b3b0e79e31529f3bebb67baf12b7af
parent2fcb88c541cf98b87a38a0f27b641663aded8802 (diff)
downloadlinux-linaro-4760195df00982b4e388e859b41a63feed6d0cab.tar.gz
ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
Loading Thumb-2 modules into an ARM kernel or vice-versa isn't guaranteed to work safely, since the kernel is not interworking- aware everywhere. This patch adds "thumb2" to the module vermagic when CONFIG_THUMB2_KERNEL is enabled, to help avoid accidental loading of modules into the wrong kernel. Signed-off-by: Dave Martin <dave.martin@linaro.org> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-rw-r--r--arch/arm/include/asm/module.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index a2b775b81cf..543b44916d2 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -40,8 +40,16 @@ struct mod_arch_specific {
#define MODULE_ARCH_VERMAGIC_P2V ""
#endif
+/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
+#ifdef CONFIG_THUMB2_KERNEL
+#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
+#else
+#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
+#endif
+
#define MODULE_ARCH_VERMAGIC \
MODULE_ARCH_VERMAGIC_ARMVSN \
+ MODULE_ARCH_VERMAGIC_ARMTHUMB \
MODULE_ARCH_VERMAGIC_P2V
#endif /* _ASM_ARM_MODULE_H */