Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbaBNEbT (ORCPT ); Thu, 13 Feb 2014 23:31:19 -0500 Received: from terminus.zytor.com ([198.137.202.10]:48161 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbaBNEbP (ORCPT ); Thu, 13 Feb 2014 23:31:15 -0500 Date: Thu, 13 Feb 2014 20:30:59 -0800 From: tip-bot for Joe Mario Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, rusty@rustcorp.com.au, jmario@redhat.com, ak@linux.intel.com, tglx@linutronix.de, hpa@linux.intel.com Reply-To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, rusty@rustcorp.com.au, jmario@redhat.com, ak@linux.intel.com, tglx@linutronix.de, hpa@linux.intel.com In-Reply-To: <1391846481-31491-5-git-send-email-ak@linux.intel.com> References: <1391846481-31491-5-git-send-email-ak@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asmlinkage] lto: Handle LTO common symbols in module loader Git-Commit-ID: 80375980f1608f43b47abc2671456b23ec68c434 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.1 (terminus.zytor.com [127.0.0.1]); Thu, 13 Feb 2014 20:31:04 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 80375980f1608f43b47abc2671456b23ec68c434 Gitweb: http://git.kernel.org/tip/80375980f1608f43b47abc2671456b23ec68c434 Author: Joe Mario AuthorDate: Sat, 8 Feb 2014 09:01:09 +0100 Committer: H. Peter Anvin CommitDate: Thu, 13 Feb 2014 20:24:50 -0800 lto: Handle LTO common symbols in module loader Here is the workaround I made for having the kernel not reject modules built with -flto. The clean solution would be to get the compiler to not emit the symbol. Or if it has to emit the symbol, then emit it as initialized data but put it into a comdat/linkonce section. Minor tweaks by AK over Joe's patch. Cc: Rusty Russell Signed-off-by: Andi Kleen Link: http://lkml.kernel.org/r/1391846481-31491-5-git-send-email-ak@linux.intel.com Signed-off-by: H. Peter Anvin --- kernel/module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/module.c b/kernel/module.c index d24fcf2..b99e801 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1948,6 +1948,10 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) switch (sym[i].st_shndx) { case SHN_COMMON: + /* Ignore common symbols */ + if (!strncmp(name, "__gnu_lto", 9)) + break; + /* We compiled with -fno-common. These are not supposed to happen. */ pr_debug("Common symbol: %s\n", name); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/