All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 30/37] modpost: remove mod->is_dot_o struct member
Date: Mon,  1 Jun 2020 14:57:24 +0900	[thread overview]
Message-ID: <20200601055731.3006266-30-masahiroy@kernel.org> (raw)
In-Reply-To: <20200601055731.3006266-1-masahiroy@kernel.org>

Previously, there were two cases where mod->is_dot_o is unset:

[1] the executable 'vmlinux' in the second pass of modpost
[2] modules loaded by read_dump()

I think [1] was intended usage to distinguish 'vmlinux.o' and 'vmlinux'.
Now that modpost does not parse the executable 'vmlinux', this case
does not happen.

[2] is obscure, maybe a bug. Module.symver stores module paths without
extension. So, none of modules loaded by read_dump() has the .o suffix,
and new_module() unsets ->is_dot_o. Anyway, it is not a big deal because
handle_symbol() is not called for the case.

To sum up, all the parsed ELF files are .o files.

mod->is_dot_o is unneeded.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/mod/modpost.c | 14 ++------------
 scripts/mod/modpost.h |  1 -
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index b667f531a645..bc00bbac50bb 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -182,10 +182,8 @@ static struct module *new_module(const char *modname)
 	p = NOFAIL(strdup(modname));
 
 	/* strip trailing .o */
-	if (strends(p, ".o")) {
+	if (strends(p, ".o"))
 		p[strlen(p) - 2] = '\0';
-		mod->is_dot_o = 1;
-	}
 
 	/* add to list */
 	mod->name = p;
@@ -716,8 +714,7 @@ static void handle_symbol(struct module *mod, struct elf_info *info,
 	enum export export;
 	const char *name;
 
-	if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
-	    strstarts(symname, "__ksymtab"))
+	if (strstarts(symname, "__ksymtab"))
 		export = export_from_secname(info, get_secindex(info, sym));
 	else
 		export = export_from_sec(info, get_secindex(info, sym));
@@ -2676,13 +2673,6 @@ int main(int argc, char **argv)
 		struct symbol *s;
 
 		for (s = symbolhash[n]; s; s = s->next) {
-			/*
-			 * Do not check "vmlinux". This avoids the same warnings
-			 * shown twice, and false-positives for ARCH=um.
-			 */
-			if (is_vmlinux(s->module->name) && !s->module->is_dot_o)
-				continue;
-
 			if (s->is_static)
 				warn("\"%s\" [%s] is a static %s\n",
 				     s->name, s->module->name,
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index aaf3c4ad5d60..554f02c69ac2 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -126,7 +126,6 @@ struct module {
 	int has_cleanup;
 	struct buffer dev_table_buf;
 	char	     srcversion[25];
-	int is_dot_o;
 	// Missing namespace dependencies
 	struct namespace_list *missing_namespaces;
 	// Actual imported namespaces
-- 
2.25.1

  parent reply	other threads:[~2020-06-01  5:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  5:56 [PATCH 01/37] kbuild: refactor subdir-ym calculation Masahiro Yamada
2020-06-01  5:56 ` [PATCH 02/37] kbuild: refactor tagets caluculation for KBUILD_{BUILTIN,KBUILD_MODULES} Masahiro Yamada
2020-06-01  5:56 ` [PATCH 03/37] kbuild: merge init-y into core-y Masahiro Yamada
2020-06-01  5:56 ` [PATCH 04/37] kbuild: merge net-y and virt-y into drivers-y Masahiro Yamada
2020-06-01  5:56 ` [PATCH 05/37] kbuild: refactor KBUILD_VMLINUX_{OBJS,LIBS} calculation Masahiro Yamada
2020-06-03  4:21   ` Masahiro Yamada
2020-06-01  5:57 ` [PATCH 06/37] kbuild: update modules.order only when contained modules are updated Masahiro Yamada
2020-06-01  5:57 ` [PATCH 07/37] modpost: fix -i (--ignore-errors) MAKEFLAGS detection Masahiro Yamada
2020-06-01  5:57 ` [PATCH 08/37] modpost: move -T option close to the modpost command Masahiro Yamada
2020-06-01  5:57 ` [PATCH 09/37] modpost: pass -N option only for modules modpost Masahiro Yamada
2020-06-01  5:57 ` [PATCH 10/37] modpost: load KBUILD_EXTRA_SYMBOLS files in order Masahiro Yamada
2020-06-01  5:57 ` [PATCH 11/37] modpost: track if the symbol origin is a dump file or ELF object Masahiro Yamada
2020-06-01  5:57 ` [PATCH 12/37] modpost: allow to pass -i option multiple times to remove -e option Masahiro Yamada
2020-06-01  5:57 ` [PATCH 13/37] modpost: rename ext_sym_list to dump_list Masahiro Yamada
2020-06-01  5:57 ` [PATCH 14/37] modpost: re-add -e to set external_module flag Masahiro Yamada
2020-06-01  5:57 ` [PATCH 15/37] modpost: print symbol dump file as the build target in short log Masahiro Yamada
2020-06-01  5:57 ` [PATCH 16/37] modpost: refactor -i option calculation Masahiro Yamada
2020-06-01  5:57 ` [PATCH 17/37] modpost: generate vmlinux.symvers and reuse it for the second modpost Masahiro Yamada
2020-06-01  5:57 ` [PATCH 18/37] modpost: invoke modpost only when input files are updated Masahiro Yamada
2020-06-01  5:57 ` [PATCH 19/37] modpost: show warning if vmlinux is not found when processing modules Masahiro Yamada
2020-06-01  5:57 ` [PATCH 20/37] modpost: show warning if any of symbol dump files is missing Masahiro Yamada
2020-06-01  5:57 ` [PATCH 21/37] modpost: drop RCS/CVS $Revision handling in MODULE_VERSION() Masahiro Yamada
2020-06-01  5:57 ` [PATCH 22/37] modpost: do not call get_modinfo() for vmlinux(.o) Masahiro Yamada
2020-06-01  5:57 ` [PATCH 23/37] modpost: add read_text_file() and get_line() helpers Masahiro Yamada
2020-06-01  5:57 ` [PATCH 24/37] modpost: fix potential mmap'ed file overrun in get_src_version() Masahiro Yamada
2020-06-01  5:57 ` [PATCH 25/37] modpost: avoid false-positive file open error Masahiro Yamada
2020-06-01  5:57 ` [PATCH 26/37] modpost: use read_text_file() and get_line() for reading text files Masahiro Yamada
2020-06-01  5:57 ` [PATCH 27/37] modpost: remove get_next_text() and make {grab,release_}file static Masahiro Yamada
2020-06-01  5:57 ` [PATCH 28/37] modpost: remove -s option Masahiro Yamada
2020-06-01  5:57 ` [PATCH 29/37] modpost: move -d option in scripts/Makefile.modpost Masahiro Yamada
2020-06-01  5:57 ` Masahiro Yamada [this message]
2020-06-01  5:57 ` [PATCH 31/37] modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}() Masahiro Yamada
2020-06-01  5:57 ` [PATCH 32/37] modpost: add mod->is_vmlinux struct member Masahiro Yamada
2020-06-01  5:57 ` [PATCH 33/37] modpost: remove mod->skip " Masahiro Yamada
2020-06-01  5:57 ` [PATCH 34/37] modpost: set have_vmlinux in new_module() Masahiro Yamada
2020-06-01  5:57 ` [PATCH 35/37] modpost: strip .o from modname before calling new_module() Masahiro Yamada
2020-06-01  5:57 ` [PATCH 36/37] modpost: remove is_vmlinux() helper Masahiro Yamada
2020-06-01  5:57 ` [PATCH 37/37] modpost: change elf_info->size to size_t Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200601055731.3006266-30-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.