mirror of
https://github.com/dynup/kpatch
synced 2025-02-25 14:31:00 +00:00
Merge pull request #272 from spartacus06/fix-new-func-handling
create-diff-object: fixup new function handling
This commit is contained in:
commit
0c2c498a8e
@ -948,7 +948,8 @@ void kpatch_include_symbol(struct symbol *sym, int recurselevel)
|
|||||||
* if an unchanged local symbol. This a base case for the
|
* if an unchanged local symbol. This a base case for the
|
||||||
* inclusion recursion.
|
* inclusion recursion.
|
||||||
*/
|
*/
|
||||||
if (!sym->sec || (sym->type != STT_SECTION && sym->status == SAME))
|
if (!sym->sec || sym->sec->include ||
|
||||||
|
(sym->type != STT_SECTION && sym->status == SAME))
|
||||||
goto out;
|
goto out;
|
||||||
sec = sym->sec;
|
sec = sym->sec;
|
||||||
sec->include = 1;
|
sec->include = 1;
|
||||||
@ -961,11 +962,8 @@ void kpatch_include_symbol(struct symbol *sym, int recurselevel)
|
|||||||
goto out;
|
goto out;
|
||||||
sec->rela->include = 1;
|
sec->rela->include = 1;
|
||||||
inc_printf("section %s is included\n", sec->rela->name);
|
inc_printf("section %s is included\n", sec->rela->name);
|
||||||
list_for_each_entry(rela, &sec->rela->relas, list) {
|
list_for_each_entry(rela, &sec->rela->relas, list)
|
||||||
if (rela->sym->include)
|
|
||||||
continue;
|
|
||||||
kpatch_include_symbol(rela->sym, recurselevel+1);
|
kpatch_include_symbol(rela->sym, recurselevel+1);
|
||||||
}
|
|
||||||
out:
|
out:
|
||||||
inc_printf("end include_symbol(%s)\n", sym->name);
|
inc_printf("end include_symbol(%s)\n", sym->name);
|
||||||
return;
|
return;
|
||||||
@ -1002,12 +1000,6 @@ int kpatch_include_changed_functions(struct kpatch_elf *kelf)
|
|||||||
kpatch_include_symbol(sym, 0);
|
kpatch_include_symbol(sym, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sym->status == NEW &&
|
|
||||||
sym->type == STT_FUNC) {
|
|
||||||
log_normal("new function: %s\n", sym->name);
|
|
||||||
kpatch_include_symbol(sym, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sym->type == STT_FILE)
|
if (sym->type == STT_FILE)
|
||||||
sym->include = 1;
|
sym->include = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user