]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ppc: Check for compilers that don't support relocation
authorPeter Tyser <ptyser@xes-inc.com>
Mon, 21 Sep 2009 16:20:26 +0000 (11:20 -0500)
committerWolfgang Denk <wd@denx.de>
Sat, 3 Oct 2009 08:15:45 +0000 (10:15 +0200)
Certain ppc compilers are known not to generate the .fixup section
properly.  The .fixup section is necessary to create a relocatable
U-Boot image.  A basic check for the existence of the .fixup section
should hopefully catch the majority of broken compilers which don't
support relocation.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
lib_ppc/Makefile

index 60ea0c91393e61259a1f2feffeceef1f5f9742ed..399b41e31e0e30143ebedd10b2bfc08a208a045b 100644 (file)
@@ -42,6 +42,12 @@ SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
+       @if ! $(CROSS_COMPILE)readelf -S $(OBJS) | grep -q '\.fixup.*PROGBITS';\
+       then \
+               echo "ERROR: Your compiler doesn't generate .fixup sections!";\
+               echo "       Upgrade to a recent toolchain."; \
+               exit 1; \
+       fi;
        $(AR) $(ARFLAGS) $@ $(OBJS)
 
 #########################################################################