From patchwork Tue Nov 15 15:45:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9430099 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 7C9B460471 for ; Tue, 15 Nov 2016 15:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D501285DE for ; Tue, 15 Nov 2016 15:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6209C2865A; Tue, 15 Nov 2016 15:46:01 +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 E5B96285DE for ; Tue, 15 Nov 2016 15:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933828AbcKOPqA convert rfc822-to-8bit (ORCPT ); Tue, 15 Nov 2016 10:46:00 -0500 Received: from prv-mh.provo.novell.com ([137.65.248.74]:58797 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755689AbcKOPqA (ORCPT ); Tue, 15 Nov 2016 10:46:00 -0500 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 15 Nov 2016 08:45:58 -0700 Message-Id: <582B3BC5020000780011EF53@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Tue, 15 Nov 2016 08:45:57 -0700 From: "Jan Beulich" To: "Michal Marek" Cc: Subject: [PATCH] modpost: treat undefined CRC symbols as absent Mime-Version: 1.0 Content-Disposition: inline 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 Apparently dependent on binutils version, undefined CRC symbols may or may not make it into the final binary's symbol table. Treat undefined ones as absent instead of as having value zero. Signed-off-by: Jan Beulich --- I've only noticed this with the recent switch to exporting symbols defined in assembly files from their source files, as that has caused a number of such symbols to appear. --- scripts/mod/modpost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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 --- 4.9-rc5/scripts/mod/modpost.c +++ 4.9-rc5-ignore-undef-CRC/scripts/mod/modpost.c @@ -617,7 +617,8 @@ static void handle_modversions(struct mo export = export_from_sec(info, get_secindex(info, sym)); /* CRC'd symbol */ - if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { + if (sym->st_shndx != SHN_UNDEF && + strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { crc = (unsigned int) sym->st_value; sym_update_crc(symname + strlen(CRC_PFX), mod, crc, export);