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: 101435 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp235544qgi; Fri, 2 Dec 2016 04:42:03 -0800 (PST) X-Received: by 10.99.240.83 with SMTP id s19mr77843652pgj.175.1480682522950; Fri, 02 Dec 2016 04:42:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si5011329pfi.107.2016.12.02.04.42.02; Fri, 02 Dec 2016 04:42:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760622AbcLBMlw (ORCPT + 25 others); 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 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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