powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE
commit144ef909c09b60c97b3c20b69ea30abd1e60e54d
authorTony Breeds <tony@bakeyournoodle.com>
Mon, 14 Sep 2009 19:57:02 +0000 (14 19:57 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 24 Sep 2009 05:31:40 +0000 (24 15:31 +1000)
treebfade6f9d26ea4fddaf72e7c7f10102758fcacb6
parentad08587e5df17e192a57437bfedaba125998de25
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>
arch/powerpc/Makefile
arch/powerpc/relocs_check.pl [new file with mode: 0755]