aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorTony Breeds <tony@bakeyournoodle.com>2009-09-14 15:57:02 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-09-24 01:31:40 -0400
commit144ef909c09b60c97b3c20b69ea30abd1e60e54d (patch)
treebfade6f9d26ea4fddaf72e7c7f10102758fcacb6 /arch/powerpc/Makefile
parentad08587e5df17e192a57437bfedaba125998de25 (diff)
powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE
When using CONFIG_RELOCATABLE, we build the kernel as a position independent executable. The kernel then uses a little bit of relocation code to relocate itself. That code only deals with R_PPC64_RELATIVE relocations though. If for some reason you use assembly constructs such as LOAD_REG_IMMEDIATE() to load the address of a symbol, you'll generate different kinds of relocations that won't be processed properly and bad things will happen. (We have 2 such bugs today). The perl script tries to filter out "known" bad ones. It's possible that we are missing some in the case of a weak function that nobody implements, we'll see if we get false positive and fix it. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index aacf629c1a9f..1a54a3b3a3fa 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -164,6 +164,17 @@ PHONY += $(BOOT_TARGETS)
164 164
165boot := arch/$(ARCH)/boot 165boot := arch/$(ARCH)/boot
166 166
167ifeq ($(CONFIG_RELOCATABLE),y)
168quiet_cmd_relocs_check = CALL $<
169 cmd_relocs_check = perl $< "$(OBJDUMP)" "$(obj)/vmlinux"
170
171PHONY += relocs_check
172relocs_check: arch/powerpc/relocs_check.pl vmlinux
173 $(call cmd,relocs_check)
174
175zImage: relocs_check
176endif
177
167$(BOOT_TARGETS): vmlinux 178$(BOOT_TARGETS): vmlinux
168 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 179 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
169 180