Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760618AbcLBMlw (ORCPT ); Fri, 2 Dec 2016 07:41:52 -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 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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1200 Lines: 33 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. 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