[U-Boot] [PATCH 02/13] ppc: Check for compilers that don't support relocation

Peter Tyser ptyser at xes-inc.com
Mon Sep 21 18:20:26 CEST 2009


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 at xes-inc.com>
---
 lib_ppc/Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib_ppc/Makefile b/lib_ppc/Makefile
index 60ea0c9..399b41e 100644
--- a/lib_ppc/Makefile
+++ b/lib_ppc/Makefile
@@ -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)
 
 #########################################################################
-- 
1.6.2.1



More information about the U-Boot mailing list