Merge pull request #272 from spartacus06/fix-new-func-handling

create-diff-object: fixup new function handling
This commit is contained in:
Josh Poimboeuf 2014-06-27 09:31:46 -05:00
commit 0c2c498a8e
1 changed files with 3 additions and 11 deletions

View File

@ -948,7 +948,8 @@ void kpatch_include_symbol(struct symbol *sym, int recurselevel)
* if an unchanged local symbol. This a base case for the
* 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;
sec = sym->sec;
sec->include = 1;
@ -961,11 +962,8 @@ void kpatch_include_symbol(struct symbol *sym, int recurselevel)
goto out;
sec->rela->include = 1;
inc_printf("section %s is included\n", sec->rela->name);
list_for_each_entry(rela, &sec->rela->relas, list) {
if (rela->sym->include)
continue;
list_for_each_entry(rela, &sec->rela->relas, list)
kpatch_include_symbol(rela->sym, recurselevel+1);
}
out:
inc_printf("end include_symbol(%s)\n", sym->name);
return;
@ -1002,12 +1000,6 @@ int kpatch_include_changed_functions(struct kpatch_elf *kelf)
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)
sym->include = 1;
}