[PATCH] powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for modules.

Anton Blanchard anton at samba.org
Mon Apr 7 09:55:11 EST 2014

Hi Tony,

> When building modules with a native le toolchain the linker will
> generate R_PPC64_TOCSAVE relocations when it's safe to omit saving r2
> on a plt call.  This isn't helpful in the conext of a kernel module
> and the kernel will fail to load those modules with an error like:
> 	nf_conntrack: Unknown ADD relocation: 109
> This patch tells the linker to avoid createing R_PPC64_TOCSAVE
> relocations allowing modules to load.

Looks good.

Signed-off-by: Anton Blanchard <anton at samba.org>

> +ifeq ($(call cc-option-yn,-mno-save-toc-indirect),y)
> +       KBUILD_CFLAGS_MODULE += -mno-save-toc-indirect
> +endif

Low priority bikeshedding, but could we save ourselves a few lines with:

KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)


More information about the Linuxppc-dev mailing list