2
This commit is contained in:
@@ -494,6 +494,7 @@ static int kpm_move_module(struct kpm_module *mod, struct kpm_load_info *info)
|
|||||||
unsigned long curr_offset = 0;
|
unsigned long curr_offset = 0;
|
||||||
Elf64_Shdr *shdr;
|
Elf64_Shdr *shdr;
|
||||||
void *dest;
|
void *dest;
|
||||||
|
const char *secname;
|
||||||
|
|
||||||
/* 分配连续内存(按页对齐) */
|
/* 分配连续内存(按页对齐) */
|
||||||
mod->size = ALIGN(mod->size, PAGE_SIZE);
|
mod->size = ALIGN(mod->size, PAGE_SIZE);
|
||||||
@@ -535,7 +536,7 @@ static int kpm_move_module(struct kpm_module *mod, struct kpm_load_info *info)
|
|||||||
curr_offset += shdr->sh_size;
|
curr_offset += shdr->sh_size;
|
||||||
|
|
||||||
/* 定位关键函数指针 */
|
/* 定位关键函数指针 */
|
||||||
const char *secname = info->secstrings + shdr->sh_name;
|
secname = info->secstrings + shdr->sh_name;
|
||||||
if (!mod->init && !strcmp(".kpm.init", secname)) {
|
if (!mod->init && !strcmp(".kpm.init", secname)) {
|
||||||
mod->init = (int (*)(const char *, const char *, void *__user))dest;
|
mod->init = (int (*)(const char *, const char *, void *__user))dest;
|
||||||
printk(KERN_DEBUG "Found .kpm.init at 0x%px\n", dest);
|
printk(KERN_DEBUG "Found .kpm.init at 0x%px\n", dest);
|
||||||
|
|||||||
Reference in New Issue
Block a user