From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbcGGQCC (ORCPT ); Thu, 7 Jul 2016 12:02:02 -0400 Received: from mail.kernel.org ([198.145.29.136]:35826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbcGGQBx (ORCPT ); Thu, 7 Jul 2016 12:01:53 -0400 From: "Luis R. Rodriguez" To: andi@firstfloor.org Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, x86@kernel.org, bp@alien8.de, luto@amacapital.net, "Luis R. Rodriguez" Subject: [PATCH v2] x86: remove LTO_REFERENCE_INITCALL() Date: Thu, 7 Jul 2016 09:01:49 -0700 Message-Id: <1467907309-6678-1-git-send-email-mcgrof@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <20160707015500.GQ13997@two.firstfloor.org> References: <20160707015500.GQ13997@two.firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The setup for LTO never made it upstream, and although this has some users, this is now really old stuff for a gcc 4.7 LTO problem. We know that at least LTO_REFERENCE_INITCALL() work around can be removed if LTO is not supported on v4.7 anymore. As per Andi the DISABLE_LTO and LTO_CFLAGS are still neeeded though. Tested-by: 0-day Signed-off-by: Luis R. Rodriguez --- include/linux/init.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index 1e5c131d5c9a..aa662ad80d9c 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -151,23 +151,6 @@ extern bool initcall_debug; #ifndef __ASSEMBLY__ -#ifdef CONFIG_LTO -/* Work around a LTO gcc problem: when there is no reference to a variable - * in a module it will be moved to the end of the program. This causes - * reordering of initcalls which the kernel does not like. - * Add a dummy reference function to avoid this. The function is - * deleted by the linker. - */ -#define LTO_REFERENCE_INITCALL(x) \ - ; /* yes this is needed */ \ - static __used __exit void *reference_##x(void) \ - { \ - return &x; \ - } -#else -#define LTO_REFERENCE_INITCALL(x) -#endif - /* initcalls are now grouped by functionality into separate * subsections. Ordering inside the subsections is determined * by link order. @@ -180,8 +163,7 @@ extern bool initcall_debug; #define __define_initcall(fn, id) \ static initcall_t __initcall_##fn##id __used \ - __attribute__((__section__(".initcall" #id ".init"))) = fn; \ - LTO_REFERENCE_INITCALL(__initcall_##fn##id) + __attribute__((__section__(".initcall" #id ".init"))) = fn; /* * Early initcalls run before initializing SMP. -- 2.8.4