aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert ARIBAUD2013-06-11 07:17:30 -0500
committerAlbert ARIBAUD2013-06-21 15:59:20 -0500
commitc37980c31a30f0623a0ca8f112298e44039ed6bb (patch)
tree85af61bd66e05bd9da198f5098ef56f7ebbe34a5 /Makefile
parent7737c994609ffb50194d5ddb67467ae0fcd8f775 (diff)
downloadu-boot-c37980c31a30f0623a0ca8f112298e44039ed6bb.tar.gz
u-boot-c37980c31a30f0623a0ca8f112298e44039ed6bb.tar.xz
u-boot-c37980c31a30f0623a0ca8f112298e44039ed6bb.zip
arm: ensure u-boot only uses relative relocations
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 <albert.u.boot@aribaud.net> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Tested-by: Jeroen Hofstee <jeroen@myspectrum.nl> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index af4c3c0a98..b1e5d5f52e 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,13 @@ tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
743 $(MAKE) -C $@ all 743 $(MAKE) -C $@ all
744endif # config.mk 744endif # config.mk
745 745
746# ARM relocations should all be R_ARM_RELATIVE.
747checkarmreloc: $(obj)u-boot
748 @if test "R_ARM_RELATIVE" != \
749 "`readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \
750 then echo "$< contains relocations other than \
751 R_ARM_RELATIVE"; false; fi
752
746$(VERSION_FILE): 753$(VERSION_FILE):
747 @mkdir -p $(dir $(VERSION_FILE)) 754 @mkdir -p $(dir $(VERSION_FILE))
748 @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ 755 @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \