arm: implement ELF relocations

ELF relocation tables generated with linker option -pie can
be used to fixup code and data in a single loop at relocation,
removing the need for manual fixups anywhere else in the code.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 6923f6d..0be47d3 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -33,11 +33,6 @@
 endif
 endif
 
-ifndef CONFIG_SYS_ARM_WITHOUT_RELOC
-# needed for relocation
-PLATFORM_RELFLAGS += -fPIC
-endif
-
 ifdef CONFIG_SYS_ARM_WITHOUT_RELOC
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_ARM_WITHOUT_RELOC
 endif
@@ -72,3 +67,8 @@
 endif
 endif
 LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
+
+ifndef CONFIG_SYS_ARM_WITHOUT_RELOC
+# needed for relocation
+PLATFORM_LDFLAGS += -pie
+endif