Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751722AbcLCKoL (ORCPT ); Sat, 3 Dec 2016 05:44:11 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:54482 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbcLCKoI (ORCPT ); Sat, 3 Dec 2016 05:44:08 -0500 From: Arnd Bergmann To: Ben Hutchings Cc: Linus Torvalds , Adam Borowski , Greg Kroah-Hartman , Linux Kbuild mailing list , Michal Marek , Debian kernel maintainers , "linux-arch@vger.kernel.org" , Ingo Molnar , Nicholas Piggin , Linux Kernel Mailing List , Alan Modra Subject: Re: [RFC, PATCH, v3.9] default exported asm symbols to zero Date: Sat, 03 Dec 2016 11:43:07 +0100 Message-ID: <55460922.iQ4WX6OtHo@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1480739797.16599.118.camel@decadent.org.uk> References: <20161129131922.GA31466@angband.pl> <8452191.39CeLIHTBT@wuerfel> <1480739797.16599.118.camel@decadent.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:LMiyJh48ocCkIgnQBCep2T/0GoUsn0swwlZkUmkGpd5tl44V24F WGXfqu+eKX5BLgdcBVTbdQAt7BIvHnovvEowDJbbSSNFaB+xJY3BCQxtWZZbnZ8GpzlBYkj tjRpAgljMMA7AOFaGHwNqYYop8cUIuTXuyYu3ShGMBVq9Y1d+i0LFkSUkYxg7lT3nKVdN0i P7GKyMBRguN5RGvfE5TFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:7rhxc3MBB64=:5cKSbSNWkEKA52W2zhm7/h b+T0U9Kw+nZmLK13E5TqQrUVQ7f8jzytzoslTzuAzdcD9iPl0M5Q/DFco3xVG1+3enqW7fVlN CQPNYfs0VxdqW2SyFxBwqF9K37fPGMbZ8L4qvboFMqcrSm6/1RUgA9wbq3x39+6wJ2C4vOsY2 I6fIdxZhqsE3r0pjt07+31E8N18NT0BVYw7hTwvw69ICtVIhCmxY76Jz/J7HwHNs2+Ohlskl4 W6Vc1Ady2xC7NIWdAwtiI4djCM1AZeMBoatHkXGEHDVJXqKVK/euS1Sm+dHWdAkK+fwwifi5f IqYsz3r2DjBeBEeGlEXJ/oxF7z301i7Mkxl98QwMrBgalWj8R72HqiJ2ZUyUDa1+V3aaVUZYh drDOt2VqcO9E2frtjZnUbDlS4fD665kiccBOeSQP8nBv0NL4uSHnV3+30Po5Px3ugWeFqrSW6 b+kh5t9wHvqzbG0As4BfhbAT0TvhiNT/p6ieMMp9Lr/jXBZyt8HGZS6RuXDgr0k8gDuSb4HLD Q38kvTQnl4PaQ585g4BwZqqwBd1bGH6CYN0kFFugH4+GsxwUEj5DM9WtKYuYU7puEFVHkoLdP i7ca2mGwoxsOJPI3FTA3f0lV6QKULmFmEXU1S10IxDiMla8VhQnkC9xGESsxzGCiqItElj/ce yaY3CkUyrt1a0X4lDqWINy9HQFp4a7Mnydw4JhXFKEKsBY3iyRuMRJGjyqk+quZu/YXCp72b3 24AUzVF+q2Tyt/tn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1607 Lines: 34 On Saturday, December 3, 2016 4:36:37 AM CET Ben Hutchings wrote: > On Fri, 2016-12-02 at 13:40 +0100, Arnd Bergmann wrote: > > 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. > > I tried this along with Adam's patch on x86_64, with Debian's binutils > 2.27.51.20161127. The result was that the kernel's __kcrctab held 0 > for several symbols, even though there was type information in asm- > prototypes.h and Module.symvers and the modules had a non-zero CRC for > those symbols. With just Adam's patch, the kernel and modules agreed. Can you be more specific? Which symbols are those? I would have expected modpost to generate Module.symvers from the vmlinux file, so I wonder where that difference comes from. Arnd