[PATCH] ARM/S3C2440: Don't build armv4t modules we can't load

Rask Ingemann Lambertsen rask at sygehus.dk
Sun Mar 1 17:59:23 CET 2009

   The kernel can't load armv4t modules ("unknown relocation: 40"). This
patch fixes the ARM makefile accordingly to tell GCC to generate armv4 code
instead of armv4t code. The assembler still needs to allow armv4t
instructions for some object files which are linked into the kernel.

Signed-off-by: Rask Ingemann Lambertsen <rask at sygehus.dk>


   The patch is against andy-tracking
b33f0a20da8bc5816d6d2e92aca7d417e1ebf782. Tested on a GTA02. I think the
problem is triggered by a recent upgrade of GCC and/or binutils:

$ gcc --version | head -n 1
gcc (Debian 4.3.3-4) 4.3.3
$ as --version | head -n 1
GNU assembler (GNU Binutils for Debian) 2.19.1

 arch/arm/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 24e0f01..3d6601b 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -55,7 +55,8 @@ ifeq ($(CONFIG_CPU_32v6),y)
 arch-$(CONFIG_CPU_32v6K)	:=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
 arch-$(CONFIG_CPU_32v5)		:=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
-arch-$(CONFIG_CPU_32v4T)	:=-D__LINUX_ARM_ARCH__=4 -march=armv4t
+# We can't load armv4t modules, but still need to assemble some armv4t code to be linked in.
+arch-$(CONFIG_CPU_32v4T)	:=-D__LINUX_ARM_ARCH__=4 -march=armv4 -Wa,-march=armv4t
 arch-$(CONFIG_CPU_32v4)		:=-D__LINUX_ARM_ARCH__=4 -march=armv4
 arch-$(CONFIG_CPU_32v3)		:=-D__LINUX_ARM_ARCH__=3 -march=armv3

Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year

More information about the openmoko-kernel mailing list