From patchwork Fri Feb 1 04:50:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 157170 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp8052421jaa; Thu, 31 Jan 2019 20:51:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN6I5V8yar/4UJYbSEVqoMr26p1RoLHxugmyXoD3R/Tv/Xi6YEQ2OutmF3oBc1OWGw4f50hp X-Received: by 2002:a62:11c7:: with SMTP id 68mr37623297pfr.21.1548996689829; Thu, 31 Jan 2019 20:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548996689; cv=none; d=google.com; s=arc-20160816; b=Hi7cYb5FOvttx6mQY5TORjngKICkB5DxREaALxRYHhw5ESPNd/pxlW5Ci2PNPaJM9l iQh9kyCllBQOKjGuudQb7npUxtF2kEL0d2iSsOtqMnmGT3ehwh50X/zroyomBPQS6Axx WbVDsSKL2Ri1ILwZiSs5lTZ1HAwH4YYrbgWndI5ATELb7e9w8/qWFeeSWtGbJUA7YAu7 oHHE4ejaIMRsyCW8JdZAopHxb2nGgMoUxJ2EwGGE5Aq/bNav8A9FaSSNS1FpR6gFEQJX krnkNE0I56VzXwXG/Uzh55I/6WGDMC9vQv0WyMzhfj7Dvsd5HxHzkC5y9x16aUEorV7P LD9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=zJxi2dBrPs9Bw9L9tlVtOplaKEBlf4+s06/35cIfvfU=; b=iiO5NVGOWLDEv0/g3paz/71NiGye2MzAkJkzBdmwg6uoHN4jvAKedXHTcKMfrneWBx 6JuZmE55ptE+FrHqgpLuEAA94hZsEk4OyZw2rSASDbkicbNR0xa7gSun1mGCImdpEtoU UIMWLW6dgh9iNWJ+TyujfJPELTMfY2sSE76zVIVOfeGvp/7qb739IoeI+MSCQ26Djxoh +spkR0FRCAbKqiVTBf7C4OfTlD4QPrnyOLwH2JqcuuJU72pNSWz8u3MI9yEKouB2Gha0 KyMH1f9XoeIhSp3eEVbjIUwaJSuTqNkmiXtElo8DLxNLJ0N6TnmCf9R6CFylGTOf4/CT VIZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gkb6lCu4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si6130180pgx.178.2019.01.31.20.51.29; Thu, 31 Jan 2019 20:51:29 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gkb6lCu4; 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 S1728186AbfBAEvZ (ORCPT + 31 others); Thu, 31 Jan 2019 23:51:25 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:53269 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfBAEvZ (ORCPT ); Thu, 31 Jan 2019 23:51:25 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x114onXv008188; Fri, 1 Feb 2019 13:50:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x114onXv008188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548996650; bh=zJxi2dBrPs9Bw9L9tlVtOplaKEBlf4+s06/35cIfvfU=; h=From:To:Cc:Subject:Date:From; b=gkb6lCu4NJEuF5OpqUcNET28mMWe5bEAfwX0TBS9k+jEwgy0TJNLlQHxqpDMqBVDZ IvML56GYsXzcGwib+ZGbrsxpZ7QpXczYPDGci+MVdoxVcL8Xy4y4akKL9gucRHfkGT 2RkT2c9QZmVlYiEYy+q1sA8laFckscCVq0MjHa8nEmR1DVRP1JrojVa5MTZykDfZtp dEdpxA61r9GrJ9ECD4EXBFUkWqYuG7Q3DojQpfOtYM05+5e7dEF35shDmHhWwwVC6o iK/7OVrHQ3ncVRC8kU+81hFzJx3BEklkdxaWjc3V3HA5DEi62dbFd2eMBYIPvzedTz hC7fg/Cv/KICQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] modpost: always show verbose warning for section mismatch Date: Fri, 1 Feb 2019 13:50:45 +0900 Message-Id: <1548996645-16962-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unless CONFIG_DEBUG_SECTION_MISMATCH is enabled, modpost only shows the number of section mismatches. If you want to know the symbols causing the issue, you need to rebuild with CONFIG_DEBUG_SECTION_MISMATCH. It is tedious. I think it is fine to show annoying warning when a new section mismatch comes in. Signed-off-by: Masahiro Yamada --- scripts/Makefile.modpost | 1 - scripts/mod/modpost.c | 27 +++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) -- 2.7.4 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index c0b7f52..6b7f354 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -77,7 +77,6 @@ modpost = scripts/mod/modpost \ $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ - $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 26bf886..0b0d108 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -35,7 +35,6 @@ static int vmlinux_section_warnings = 1; static int warn_unresolved = 0; /* How a symbol is exported */ static int sec_mismatch_count = 0; -static int sec_mismatch_verbose = 1; static int sec_mismatch_fatal = 0; /* ignore missing files */ static int ignore_missing_files; @@ -1406,8 +1405,6 @@ static void report_sec_mismatch(const char *modname, char *prl_to; sec_mismatch_count++; - if (!sec_mismatch_verbose) - return; get_pretty_name(from_is_func, &from, &from_p); get_pretty_name(to_is_func, &to, &to_p); @@ -1655,9 +1652,7 @@ static void extable_mismatch_handler(const char* modname, struct elf_info *elf, sec_mismatch_count++; - if (sec_mismatch_verbose) - report_extable_warnings(modname, elf, mismatch, r, sym, - fromsec, tosec); + report_extable_warnings(modname, elf, mismatch, r, sym, fromsec, tosec); if (match(tosec, mismatch->bad_tosec)) fatal("The relocation at %s+0x%lx references\n" @@ -2433,7 +2428,7 @@ int main(int argc, char **argv) struct ext_sym_list *extsym_iter; struct ext_sym_list *extsym_start = NULL; - while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awE")) != -1) { + while ((opt = getopt(argc, argv, "i:I:e:mnsT:o:awE")) != -1) { switch (opt) { case 'i': kernel_read = optarg; @@ -2465,9 +2460,6 @@ int main(int argc, char **argv) case 's': vmlinux_section_warnings = 0; break; - case 'S': - sec_mismatch_verbose = 0; - break; case 'T': files_source = optarg; break; @@ -2525,18 +2517,9 @@ int main(int argc, char **argv) } if (dump_write) write_dump(dump_write); - if (sec_mismatch_count) { - if (!sec_mismatch_verbose) { - warn("modpost: Found %d section mismatch(es).\n" - "To see full details build your kernel with:\n" - "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n", - sec_mismatch_count); - } - if (sec_mismatch_fatal) { - fatal("modpost: Section mismatches detected.\n" - "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); - } - } + if (sec_mismatch_count && sec_mismatch_fatal) + fatal("modpost: Section mismatches detected.\n" + "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); free(buf.p); return err;