All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michal Marek <mmarek@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>, 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	[thread overview]
Message-ID: <20161123164143.16839-7-npiggin@gmail.com> (raw)
In-Reply-To: <20161123164143.16839-1-npiggin@gmail.com>

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 <npiggin@gmail.com>
---
 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);
-- 
2.10.2


  parent reply	other threads:[~2016-11-23 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 16:41 [PATCH 0/7] kbuild patches for 4.10 Nicholas Piggin
2016-11-23 16:41 ` [PATCH 1/7] kbuild: kallsyms allow 3-pass generation if symbols size has changed Nicholas Piggin
2016-11-23 16:41 ` [PATCH 2/7] kbuild: thin archives for multi-y targets Nicholas Piggin
2016-11-23 16:41 ` [PATCH 3/7] kbuild/genksyms: handle va_list type Nicholas Piggin
2016-11-23 16:41 ` [PATCH 4/7] kbuild: improve linker compatibility with lib-ksyms.o build Nicholas Piggin
2016-11-23 16:41 ` [PATCH 5/7] kbuild: keep data tables through dead code elimination Nicholas Piggin
2016-11-23 16:41 ` Nicholas Piggin [this message]
2016-11-23 16:41 ` [PATCH 7/7] kbuild: minor improvement for thin archives build Nicholas Piggin
2016-11-29 21:25 ` [PATCH 0/7] kbuild patches for 4.10 Michal Marek

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=20161123164143.16839-7-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.com \
    /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.