[Bug c/36706] New: [Regression] linux-kernel 2.6.24 doesn't boot for arm

chris dot steel dot lnx at googlemail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 2 22:34:00 GMT 2008


I've built linux-2.6.24 for arm using gcc-4.3.1 and while it builds fine, the
resulting binary doesn't boot on qemu. If I build the same kernel with
gcc-4.2.4 it boots correctly.

The problem seems to be that the prefetch function
(linux-2.6.24/include/asm-arm/processor.h) causes a crash if it is called with
a NULL pointer argument. But only if it's compiled with gcc-4.3.x.

This patch fixes the problem, but the extra code may cost more than you gain by
having prefetch in the first place

diff -urN linux-2.6.24-clean/include/asm-arm/processor.h
linux-2.6.24/include/asm-arm/processor.h
--- linux-2.6.24-clean/include/asm-arm/processor.h      2008-01-24
22:58:37.000000000 +0000
+++ linux-2.6.24/include/asm-arm/processor.h    2008-07-02 22:44:26.052525328
+0100
@@ -105,11 +105,14 @@
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(const void *ptr)
 {
-       __asm__ __volatile__(
-               "pld\t%0"
-               :
-               : "o" (*(char *)ptr)
-               : "cc");
+       if (ptr)
+       {
+               __asm__ __volatile__(
+                       "pld\t%0"
+                       :
+                       : "o" (*(char *)ptr)
+                       : "cc");
+       }
 }

 #define ARCH_HAS_PREFETCHW


-- 
           Summary: [Regression] linux-kernel 2.6.24 doesn't boot for arm
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris dot steel dot lnx at googlemail dot com
 GCC build triplet: x86_64-cross-linux-gnu
  GCC host triplet: x86_64-cross-linux-gnu
GCC target triplet: arm-unknown-linux-gnueabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36706



More information about the Gcc-bugs mailing list