ARM: 7021/1: Check for multiple load addresses before building a uImage
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 17 Aug 2011 13:23:46 +0000 (14:23 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 17 Oct 2011 08:12:40 +0000 (09:12 +0100)
uImages need a load address specified. This makes them
incompatible with multiple zreladdrs. Catch this error
before building an uImage so that we do not end up with
broken uImages. The load address can still be specified
with LOADADDR= on the command line.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/boot/Makefile

index a1edfd5a129a653ba847b5fb310a88bacfecfc1d..176062ac7f07305014357372c42285ff07a09c68 100644 (file)
@@ -78,7 +78,16 @@ endif
 
 $(obj)/uImage: STARTADDR=$(LOADADDR)
 
+check_for_multiple_loadaddr = \
+if [ $(words $(LOADADDR)) -gt 1 ]; then \
+       echo 'multiple load addresses: $(LOADADDR)'; \
+       echo 'This is incompatible with uImages'; \
+       echo 'Specify LOADADDR on the commandline to build an uImage'; \
+       false; \
+fi
+
 $(obj)/uImage: $(obj)/zImage FORCE
+       @$(check_for_multiple_loadaddr)
        $(call if_changed,uimage)
        @echo '  Image $@ is ready'