mcctrl: lookup unexported symbols at runtime

Instead of parsing System.map, use kallsyms_lookup_name() to
get unexported symbols addresses at module loading time.

This lets mckernel work with kaslr enabled (it gets enabled by
default from el7.5 onwards)

Change-Id: Ie4349fc1145ebce44f37f1f40c16f9d75584074d
This commit is contained in:
Dominique Martinet
2018-08-03 13:12:08 +09:00
committed by Masamichi Takagi
parent 794684985f
commit e8f8660b73
10 changed files with 151 additions and 672 deletions

View File

@@ -892,16 +892,6 @@ out:
return error;
} /* read_long() */
#ifdef MCCTRL_KSYM_sys_readlink
static ssize_t (*mcctrl_sys_readlink)(const char *path, char *buf,
size_t bufsiz)
#if MCCTRL_KSYM_sys_readlink
= (void *)MCCTRL_KSYM_sys_readlink;
#else
= &sys_readlink;
#endif
#endif
static int read_link(char *buf, size_t bufsize, char *fmt, ...)
{
int error;