From patchwork Thu Aug 11 20:37:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9275943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9977160780 for ; Thu, 11 Aug 2016 20:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8632528784 for ; Thu, 11 Aug 2016 20:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7539128789; Thu, 11 Aug 2016 20:37:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A320028784 for ; Thu, 11 Aug 2016 20:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932129AbcHKUhY (ORCPT ); Thu, 11 Aug 2016 16:37:24 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:61489 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbcHKUhX (ORCPT ); Thu, 11 Aug 2016 16:37:23 -0400 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0Lzna3-1bCY6q3T2R-014yt3; Thu, 11 Aug 2016 22:37:07 +0200 From: Arnd Bergmann To: Nicolas Pitre Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, Michal Marek , Sam Ravnborg , Stephen Rothwell , Segher Boessenkool , Alan Modra Subject: Re: [EXPERIMENTAL] enable thin archives and --gc-sections on ARM Date: Thu, 11 Aug 2016 22:37:04 +0200 Message-ID: <7664972.4URQm6Y4Ik@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-31-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <1470910580-18458-1-git-send-email-npiggin@gmail.com> <3116731.ej669o70yG@wuerfel> MIME-Version: 1.0 X-Provags-ID: V03:K0:gD7+3cp9seric3sliS1b2+zCY5BB/zIz0QBL2D8/mdD1TzBznHt isMvr6N+19bjbYqtxPtU9edB2GKF6uMhJ2HJgClp60MNPUNADAR4aGy4BfOUYhQAY5Ygnu1 biplIKHp4J8CSdQmzc2EhjxTXHC9LYhBRtxMHBsrm8lbln2aGh2/nb2vsdo3VMJBnzMaB8Z tcEB1VchJrtHCbMDVChmA== X-UI-Out-Filterresults: notjunk:1; V01:K0:hDSS/vJ8/X4=:z/VZ5HXLjRktxkBZcLpVZv vBVuDBiXBGtfehR4YRaE1qvcOZ6x7WDShYKvzd81gun20RFkoocn+eZhFBzJxHDwQErnPBSFW mrK6SE38S8qmGGAtt3j0pBB4uM4UbUuNNKIrRgKpzwHFao3sQNJ8b5DV3pTRWHqoQAG86c0O6 hHiADUxyKM9o34gbjIM/5LVdr/zJnZdNqXN/MiLZRhMUrMnjH3UycvtDRzc1Uawn2wTFoKqp7 MWOWJwfYEkRuX9iLI1pnDsM7W6ou/ZyssrpIMS19VZfTNYYCjvQb8YkBTQrjsLMZ7jCTEiXgB 8/UdmKPN3tUwra77ZphGx9E1E3Gw2WUmpl7hIkOECNqZ0t04xuB48+2flnk3iBHeIUiUOM/Lr P2fc1JJNAGVdC80gNgT0qdVSjTcoz6nGStsufVpyPlWHsroxn9Pfgp84gwUQF4e7rRx857GC6 FA+kp5d1scVfkoJTeiH1Kacz803Vdep01PAbdA3OoFmnMSj71O0vo8t6Dz7V51Q+Qb+Xeftrp mFM8p+1hEMlSEzGYZntHYt5rh0iy/Wf2r6zlmz5RF794rr4MaVTY0hp44zD+UGDrny0OsP5c/ WsFVdbw37XpI7oVEDkj2ofXQXAq5MgOSbODbor62GKNTO7YC/p6dylv7ecK4a/SCfuaXXhPWQ hoYbL74rHgp+M1uWQ4gNDMjacemPF0RhzaszDyYhPRViWEQea1cGYZI7bOkXlPBDKCd/AJ3Aw Qn0KdLcHWiqRuTSW Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thursday, August 11, 2016 4:01:33 PM CEST Nicolas Pitre wrote: > > #ifdef CONFIG_SMP_ON_UP > > .init.smpalt : { > > __smpalt_begin = .; > > - *(.alt.smp.init) > > + KEEP(*(.alt.smp.init)) > > Yes unfortunately this needs a KEEP() right now as there is no explicit > references to those entries. But by doing so you force a reference from > those entries to all functions they annotate, preventing those functions > from being discarded if there isn't any reference to that code > otherwise. That's a case that falls into the "missing forward reference" > category in my slides. I see. This actually relates to an existing problem with SMP alternatives in exit sections, which cause a linker error. I've done a patch for this at some point, but didn't feel confident enough to send it out commit 0c598e53b3a0ad7daf077603618001edcf9bface Author: Arnd Bergmann Date: Sun Mar 16 20:14:30 2014 +0100 ARM: don't discard exit sections for spinlock debugging This avoids lots of warnings like this one: `.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o for each spinlock that is used in an __exit function, because the smp alternatives try to patch out the spinlock locations. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index d24e5dd2aa7a..1f5eeeb4c8d0 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -43,8 +43,7 @@ #define ARM_CPU_KEEP(x) #endif -#if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ - defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) +#if defined(CONFIG_SMP_ON_UP) || defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) #define ARM_EXIT_KEEP(x) x #define ARM_EXIT_DISCARD(x) #else