From: Nicholas Piggin <npiggin@gmail.com>
To: Michal Marek <mmarek@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>,
linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org,
Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 1/2] kbuild: modpost warn if export version crc is missing
Date: Sat, 15 Oct 2016 23:43:51 +1100 [thread overview]
Message-ID: <20161015124352.10795-2-npiggin@gmail.com> (raw)
In-Reply-To: <20161015124352.10795-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.9.3
next prev parent reply other threads:[~2016-10-15 12:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 12:43 [PATCH 0/2] kbuild: CRC versions for asm functions Nicholas Piggin
2016-10-15 12:43 ` Nicholas Piggin [this message]
2016-10-15 12:43 ` [PATCH 2/2] kbuild: modversions for exported asm symbols Nicholas Piggin
2016-10-19 14:50 ` Michal Marek
2016-10-19 14:59 ` Arnd Bergmann
2016-10-20 3:58 ` Nicholas Piggin
2016-10-20 8:03 ` Arnd Bergmann
2016-10-22 15:36 ` Michal Marek
2016-10-31 11:14 ` Nicholas Piggin
2016-11-01 14:19 ` Michal Marek
2016-11-01 14:21 ` Michal Marek
2016-11-01 14:36 ` Nicholas Piggin
2016-11-01 14:44 ` Michal Marek
2016-11-01 15:50 ` 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=20161015124352.10795-2-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=viro@zeniv.linux.org.uk \
/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.