From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 7 Apr 2014 09:55:11 +1000 From: Anton Blanchard To: Tony Breeds Subject: Re: [PATCH] powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for modules. Message-ID: <20140407095511.7677da8b@kryten> In-Reply-To: <20140312041201.GA13555@thor.bakeyournoodle.com> References: <20140312041201.GA13555@thor.bakeyournoodle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: Rusty Russell , LinuxPPC-dev , Alan Modra List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 > +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) Anton