From patchwork Wed Nov 23 16:41:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9443789 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 8D3B56075F for ; Wed, 23 Nov 2016 16:42:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9579027C0C for ; Wed, 23 Nov 2016 16:42:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A5E527C7A; Wed, 23 Nov 2016 16:42:40 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 3B04D27BE5 for ; Wed, 23 Nov 2016 16:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934743AbcKWQmf (ORCPT ); Wed, 23 Nov 2016 11:42:35 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35184 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934451AbcKWQmU (ORCPT ); Wed, 23 Nov 2016 11:42:20 -0500 Received: by mail-pg0-f68.google.com with SMTP id p66so1430825pga.2 for ; Wed, 23 Nov 2016 08:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7G0SD0RwKOLpQi9lhdmAwIOgARLVB01kkQrz4BKeH7w=; b=i3zhldhkCWCMY2s+nOSFCXwdBRiTFbS1BxSmmOu7WTXmEfLzV9IMqFWZPykZF/sOYi PWl152Tu8X3e7QxdsfYYDuJld+8J0RdqAm9qGH85wJvcpmF4bh8P/KsPTgheXkGHjPRf bkRNFurs9u0KZCgVxqF9D8nsnzpUCdHD6znM6Ec1/uSIGGSJ0Y5VQPN2Aa+EqK7vFx6z 6L3CohxvB//sVLqhfs+rHGcTiS67nOCHTqlzge+0uUgsz8KY4bn5CxSw8BG/HV8TzoAW Y8LQtPF5VMcJSAbYhY3WY7CZ94lGXFA7Qn3wvaEb0IWN7n9qaRLAeJlCJdldQCkzA4EE DCmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7G0SD0RwKOLpQi9lhdmAwIOgARLVB01kkQrz4BKeH7w=; b=DUG68tn8k88v3NAJYNJV0MoMYa/vYOPw42jAd5MqA06kY3uGIfui3zClOU3zQGA2X7 CF4d/zb0sYWnQhoOQIy3d9ddJZxRPd59puApEj2U6mlF4baXWrI9UXvtjogiLT72EZg2 J41L33P3FungDEzxT7wTq5EeOLoJ37TED+p7L9rRwKIFvNlPJN8x9GCIwqsreHFKP41z kcszqrPi5lB+/DgLwvqCVe96eUGPExHnzai6BCJcd6itrSeQJ0y2DnplBzxEMpn9wknw Y3fX1GUoMA+jKy4oqb5Xkvt9/CAO/ANjLS7oEFpUz6WXRRLPaNTIOCY3ve8I49sFrEqu 3hyQ== X-Gm-Message-State: AKaTC00FdmAyFAODCx/xL5LbeSkvOG2Kjp6k8dQCIGT8jonHHUyPBSvzsLobFTHtrx+m1w== X-Received: by 10.84.210.167 with SMTP id a36mr8481688pli.125.1479919339336; Wed, 23 Nov 2016 08:42:19 -0800 (PST) Received: from roar.au.ibm.com (27-33-21-189.tpgi.com.au. [27.33.21.189]) by smtp.gmail.com with ESMTPSA id o26sm53959762pfk.91.2016.11.23.08.42.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 08:42:18 -0800 (PST) From: Nicholas Piggin To: Michal Marek Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org Subject: [PATCH 6/7] kbuild: modpost warn if export version crc is missing Date: Thu, 24 Nov 2016 03:41:42 +1100 Message-Id: <20161123164143.16839-7-npiggin@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161123164143.16839-1-npiggin@gmail.com> References: <20161123164143.16839-1-npiggin@gmail.com> 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 This catches the failing ceph CRC on with: LD vmlinux.o MODPOST vmlinux.o WARNING: EXPORT symbol "ceph_monc_do_statfs" [vmlinux] version generation failed, symbol will not be versioned. When the modules referring to exported symbols are built, there is an existing warning for missing CRC, but it's not always the case such any such module will be built, and in any case it is useful to get a warning at the source. This gets a little verbose with CONFIG_DEBUG_SECTION_MISMATCH, producing a warning with each object linked, but I didn't think that warranted extra complexity to avoid. Signed-off-by: Nicholas Piggin --- scripts/mod/modpost.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index bd83497..08f62a1 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -609,6 +609,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, { unsigned int crc; enum export export; + bool is_crc = false; if ((!is_vmlinux(mod->name) || mod->is_dot_o) && strncmp(symname, "__ksymtab", 9) == 0) @@ -618,6 +619,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, /* CRC'd symbol */ if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { + is_crc = true; crc = (unsigned int) sym->st_value; sym_update_crc(symname + strlen(CRC_PFX), mod, crc, export); @@ -663,6 +665,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info, else symname++; #endif + if (is_crc) { + const char *e = is_vmlinux(mod->name) ?"":".ko"; + warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", symname + strlen(CRC_PFX), mod->name, e); + } mod->unres = alloc_symbol(symname, ELF_ST_BIND(sym->st_info) == STB_WEAK, mod->unres);