From e60aae7b875a20ea40fe94f3ccb9ebc30f04e67b Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Thu, 26 Jun 2014 13:32:37 -0500 Subject: [PATCH] create-diff-object: fixup new function handling The original logic in the inclusion tree code worked under the assumption that it was the only code path marking symbols for inclusion. Therefore, if the symbol had been marked as included, it could be safely assumed that we also already called kpatch_include_symbol() on it. With the special section handling marking symbols as included, however, this assumption is not valid. We should call kpatch_include_symbol() regardless of whether or not the symbol has already been marked as included or not in order to possible include the symbol's entire bundle. Signed-off-by: Seth Jennings --- kpatch-build/create-diff-object.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index c5e899cce..7d43fb856 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -961,11 +961,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 +999,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; }