From patchwork Sat Oct 15 12:43:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9377781 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 CD2DA60779 for ; Sat, 15 Oct 2016 12:44:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEE5229396 for ; Sat, 15 Oct 2016 12:44:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3AE0293AE; Sat, 15 Oct 2016 12:44:21 +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 3137D29396 for ; Sat, 15 Oct 2016 12:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753657AbcJOMoU (ORCPT ); Sat, 15 Oct 2016 08:44:20 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36216 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752917AbcJOMoU (ORCPT ); Sat, 15 Oct 2016 08:44:20 -0400 Received: by mail-pa0-f68.google.com with SMTP id os4so3139127pac.3; Sat, 15 Oct 2016 05:44:19 -0700 (PDT) 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=thWliktRn031/nEgSE30kuBMwh+exyFDwLwafFX4aQE=; b=TgGj+UwPy+GoW3dbbhQ+kBJkEmMWIvLNTVgtbcB/qqERYKR+pHw9MNLJTjUZ4dDrtb YBuc+DUBI2sH2Xr+6oMcWFzzbGBvWrTfYJcPMVGKAYNABG1Rc+jKtzDnroZgkZrf95Cj v4vq7+bInFMemOa/zIHoJ3nIDTgxqOLSEIY+dvVwZDhYPrX0BRx9XR8kwto6cm8m6GC8 6vopfID+BI5Pkr0MsAYxwtsHMPOTvuq3pCULNLykHoTU1MkhSvhaSCv/jcnTcUUD1Szu HPsb6BwvdA0X4PnjEftWjv82bkAVgvN5M5VgU+DRd4gpK9HF3DKnijNhYpLGgVlcJItp PkMg== 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=thWliktRn031/nEgSE30kuBMwh+exyFDwLwafFX4aQE=; b=IDYQxcbgEdE06gd8TgT5id3ETjXEmoxua0GQaNvkIfIod1LHRgpeRJn9ZDXC9T/7Ac vBr3jfX11XnTLWo4ENcJuRESUgSls8JRUTe+L1nK6KerA7Iupqu8j1kz5zVe9ez1b/xq 7dEEgEX0rD5foWEDmZmbeT15qtX5yL4Rm16xIN+Gnw3NDZyLt21OqtFNAvrhVmtH80nz eF4bO3W/kF05YX82Lt5Fr8kIrxSP+OSpFpgRpi+dlzQzPo1BxlXOMsEztdMk5BlsN6dW EyWhEOcQvK1HXGxGP29qj+abBWFBnQ8L7h3s4UP3JR5h4sF2mg4H+hcLiPH5HTYvnqKx 0ucw== X-Gm-Message-State: AA6/9RkhKOQ4qHF4LIbNOHGEowKbte2yEY+ovQxjbpqaJevp8iFl/gf6ptaclHQQXPB6uw== X-Received: by 10.66.55.9 with SMTP id n9mr20876705pap.153.1476535459374; Sat, 15 Oct 2016 05:44:19 -0700 (PDT) Received: from roar.au.ibm.com (28.9.218.139.dynamic.dsl.dv.iprimus.net.au. [139.218.9.28]) by smtp.gmail.com with ESMTPSA id x190sm34932826pfd.20.2016.10.15.05.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Oct 2016 05:44:18 -0700 (PDT) From: Nicholas Piggin To: Michal Marek Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, Al Viro , Arnd Bergmann Subject: [PATCH 1/2] kbuild: modpost warn if export version crc is missing Date: Sat, 15 Oct 2016 23:43:51 +1100 Message-Id: <20161015124352.10795-2-npiggin@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161015124352.10795-1-npiggin@gmail.com> References: <20161015124352.10795-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);