aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2016-11-23 11:41:42 -0500
committerMichal Marek <mmarek@suse.com>2016-11-29 09:58:57 -0500
commitd8c1eb86e9528214fed7909bfef988b472a76c2c (patch)
treebb0837208706a5c3212e09dc2500e83fc159dcdb
parent4b89b7f7aad5742523db801b7107598e5b5a42c8 (diff)
kbuild: modpost warn if export version crc is missing
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> Signed-off-by: Michal Marek <mmarek@suse.com>
-rw-r--r--scripts/mod/modpost.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index bd8349759095..08f62a1af67d 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,
609{ 609{
610 unsigned int crc; 610 unsigned int crc;
611 enum export export; 611 enum export export;
612 bool is_crc = false;
612 613
613 if ((!is_vmlinux(mod->name) || mod->is_dot_o) && 614 if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
614 strncmp(symname, "__ksymtab", 9) == 0) 615 strncmp(symname, "__ksymtab", 9) == 0)
@@ -618,6 +619,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
618 619
619 /* CRC'd symbol */ 620 /* CRC'd symbol */
620 if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { 621 if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
622 is_crc = true;
621 crc = (unsigned int) sym->st_value; 623 crc = (unsigned int) sym->st_value;
622 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, 624 sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
623 export); 625 export);
@@ -663,6 +665,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
663 else 665 else
664 symname++; 666 symname++;
665#endif 667#endif
668 if (is_crc) {
669 const char *e = is_vmlinux(mod->name) ?"":".ko";
670 warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", symname + strlen(CRC_PFX), mod->name, e);
671 }
666 mod->unres = alloc_symbol(symname, 672 mod->unres = alloc_symbol(symname,
667 ELF_ST_BIND(sym->st_info) == STB_WEAK, 673 ELF_ST_BIND(sym->st_info) == STB_WEAK,
668 mod->unres); 674 mod->unres);