summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2014-07-27 07:23:01 +0930
committerRusty Russell <rusty@rustcorp.com.au>2014-07-27 20:52:42 +0930
commit3a611c3cfba2106aed3187b90903855e776e2761 (patch)
treec667b6645b24e1768b6cc1f497c16bf2230aa5e9
parent15ba2236f3556fc01b9ca91394465152b5ea74b6 (diff)
downloadlinux-3a611c3cfba2106aed3187b90903855e776e2761.tar.gz
linux-3a611c3cfba2106aed3187b90903855e776e2761.tar.bz2
linux-3a611c3cfba2106aed3187b90903855e776e2761.zip
modules: Fix build error in moduleloader.h
Fengguang Wu's build bot detected that if moduleloader.h is included in a C file (used by ftrace and kprobes to access module_alloc() when available), that it can fail to build if CONFIG_MODULES and CONFIG_MODULES_USE_ELF_REL is not defined. This is because there's a printk() that dereferences struct module to print the name of the module. But as struct module does not exist when CONFIG_MODULES is not defined we get this error: include/linux/moduleloader.h: In function 'apply_relocate': >> include/linux/moduleloader.h:48:63: error: dereferencing pointer to >> incomplete type printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); ^ Reported-by: kbuild test robot <fengguang.wu@intel.com> Based-on-the-true-story-by: Steven Rostedt <rostedt@goodmis.org> Confirms-rustys-story-ends-the-same-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--include/linux/moduleloader.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index 560ca53a75fa..7eeb9bbfb816 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -45,7 +45,8 @@ static inline int apply_relocate(Elf_Shdr *sechdrs,
unsigned int relsec,
struct module *me)
{
- printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+ printk(KERN_ERR "module %s: REL relocation unsupported\n",
+ module_name(me));
return -ENOEXEC;
}
#endif
@@ -67,7 +68,8 @@ static inline int apply_relocate_add(Elf_Shdr *sechdrs,
unsigned int relsec,
struct module *me)
{
- printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name);
+ printk(KERN_ERR "module %s: REL relocation unsupported\n",
+ module_name(me));
return -ENOEXEC;
}
#endif