From patchwork Fri Dec 2 12:40:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9458349 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 96C2B60515 for ; Fri, 2 Dec 2016 12:41:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87C6028552 for ; Fri, 2 Dec 2016 12:41:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C58E28553; Fri, 2 Dec 2016 12:41:50 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 2531728550 for ; Fri, 2 Dec 2016 12:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760466AbcLBMlt (ORCPT ); Fri, 2 Dec 2016 07:41:49 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:64259 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760445AbcLBMlr (ORCPT ); Fri, 2 Dec 2016 07:41:47 -0500 Received: from wuerfel.localnet ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPSA (Nemesis) id 0MaU9p-1bx2VK0f2f-00KAlH; Fri, 02 Dec 2016 13:40:31 +0100 From: Arnd Bergmann To: Linus Torvalds Cc: Adam Borowski , Greg Kroah-Hartman , Linux Kbuild mailing list , Michal Marek , Ben Hutchings , Debian kernel maintainers , "linux-arch@vger.kernel.org" , Ingo Molnar , Nicholas Piggin , Linux Kernel Mailing List , Alan Modra Subject: [RFC, PATCH, v3.9] default exported asm symbols to zero Date: Fri, 02 Dec 2016 13:40:27 +0100 Message-ID: <8452191.39CeLIHTBT@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <14455987.OWjnZpEEup@wuerfel> References: <20161129131922.GA31466@angband.pl> <14455987.OWjnZpEEup@wuerfel> MIME-Version: 1.0 X-Provags-ID: V03:K0:cVSWEDorZ9p1kGOE/TVn1l0445fXOpPvx/U4niWScKxYcCh9D0R izzhP8ERiBw2xV8GWAox1FRMmXsxpdH9dFCAjZ05sR96lzuMdrJhBW5T+ty8xqpUsMOZBPf MSJD/sCPxpS1uIYcYXYrAcCOluLFQVRRSm4B3XjqCqolgVtNtUutQ5k9O9nWs59w+BKTRY0 wLXapDmn0Wcbi0IMXWEhw== X-UI-Out-Filterresults: notjunk:1; V01:K0:5InUbx7D15M=:674v1ZYP8bmETnKaJXRM9B tjaTpnT5P3bxGVDSGmp78/Qy7Rz5H2gktuO9CrjDiVus/VAjpkACycELxcDUzOwnhA9Bw8IBV v58SYL79SLlKuxBv/jFucCpZZ8Ia438CMZfidDCwKh8tjC+a1NOxYb10aE4UGl1PAwMlENwBT hZH2c7Jkr2ct0Jv9iHmfyEv79HW+cNYnXV3DYLYM+fpKeJiu42Fd1rBMDAHY39q5ehGD9dhzH mTx3XIMLSaoXQHclLrsXpVJpDAVEbNEg+8C37/eI7gkPqgIAk0DT16AeNnHHi7i2XicaaK3+W JlGE/cbBIptF0e/eVFJ1g4+TMcBG8mNKddNPEKmlL2oNJepTRwRBCCc78Pb5hk4GhIkCu+Fdj wVXc3aVo5Xb0f9AjkDzKsAb9We+kT3clj6HW8TexAZ3lpw6mPFmVfSvZvbB93KJx7iJXzxyeW oqnxb25FAYRtfhRHooTT6OTh+u0W2ZZ1G4nAtpt5r3fCrxKEBQuOBMqGmCovOxrqHox4skrJl DGuUoyLSBLIFvstnnp2UPUtH55E66UizTkbhHITxoWYdZMXSPSCmagiVAQDtiMVWvCv0AJ54X Y2rVkgAcdQuzYWP53z4DGUaiwB87ZQqvDxgbs6NiF3XkJ5vLJfsgzLxCXYLaHmQGzXZm7qmOM IykFenARl37MmONOdW59UEsbUhAI8HhIfAYMutOjcMtnfVV0MXiOe2thVJJgZ0QCMrR5hMF0l q8LrUG9Z028+KLDT 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 With binutils-2.16 and before, a weak missing symbol was kept during the final link, and a missing CRC for an export would lead to that CRC being treated as zero implicitly. With binutils-2.17, the crc symbol gets dropped, and any module trying to use it will fail to load. This sets the weak CRC symbol to zero explicitly, making it defined in vmlinux, which in turn lets us load the modules referring to that CRC. The comment above the __CRC_SYMBOL macro suggests that this was always the intention, although it also seems that all symbols defined in C have a correct CRC these days, and only the exports that are now done in assembly need this. Signed-off-by: Arnd Bergmann --- Not sure if this is the correct way of doing it, but this seems trivial enough and lets me build the kernel with missing CRCs with any binutils version. -- 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/include/asm-generic/export.h b/include/asm-generic/export.h index 63554e9..59a3b2f 100644 --- a/include/asm-generic/export.h +++ b/include/asm-generic/export.h @@ -54,6 +54,7 @@ KSYM(__kstrtab_\name): KSYM(__kcrctab_\name): __put KSYM(__crc_\name) .weak KSYM(__crc_\name) + .set KSYM(__crc_\name), 0 .previous #endif #endif