From c37980c31a30f0623a0ca8f112298e44039ed6bb Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Tue, 11 Jun 2013 14:17:30 +0200 Subject: arm: ensure u-boot only uses relative relocations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Makefile target ('checkarmreloc') which fails if the ELF binary contains relocation records of types other than R_ARM_RELATIVE. Signed-off-by: Albert ARIBAUD Tested-by: Lubomir Popov Tested-by: Jeroen Hofstee Reviewed-by: Benoît Thébaudeau --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index af4c3c0a98..b1e5d5f52e 100644 --- a/Makefile +++ b/Makefile @@ -743,6 +743,13 @@ tools: $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C $@ all endif # config.mk +# ARM relocations should all be R_ARM_RELATIVE. +checkarmreloc: $(obj)u-boot + @if test "R_ARM_RELATIVE" != \ + "`readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \ + then echo "$< contains relocations other than \ + R_ARM_RELATIVE"; false; fi + $(VERSION_FILE): @mkdir -p $(dir $(VERSION_FILE)) @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ -- cgit v1.2.1