[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] tools/livepatch: recognize functions in livepatch.ignore.functions
From: Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx> It is expected that the symbol has type STT_FUNC in livpatch.ignore.functions sections, but it is incorrect and results in functions not to be ignored. To actually ignore functions in livepatch.ignore.functions section, attempt to find the symbol of type STT_FUNC by its name. Signed-off-by: Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx> --- create-diff-object.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/create-diff-object.c b/create-diff-object.c index 82f777e..7e845da 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -859,6 +859,7 @@ static void kpatch_mark_ignored_functions_same(struct kpatch_elf *kelf) { struct section *sec; struct rela *rela; + struct symbol *strsym; sec = find_section_by_name(&kelf->sections, ".livepatch.ignore.functions"); if (!sec) @@ -867,8 +868,30 @@ static void kpatch_mark_ignored_functions_same(struct kpatch_elf *kelf) list_for_each_entry(rela, &sec->rela->relas, list) { if (!rela->sym->sec) ERROR("expected bundled symbol"); - if (rela->sym->type != STT_FUNC) - ERROR("expected function symbol"); + if (rela->sym->type != STT_FUNC) { + log_debug("expected function symbol and we have %d, name %s", rela->sym->type, rela->sym->name); + if (rela->string) { + log_debug(", rela string %s\n", rela->string); + strsym = find_symbol_by_name(&kelf->symbols, rela->string); + if (!strsym) + ERROR("can't find %s symbol to ignore\n", rela->string); + else { + if (strsym->type != STT_FUNC) + ERROR("symbol %s is not function to ignore\n", strsym->name); + else { + strsym->status = SAME; + strsym->sec->status = SAME; + if (strsym->sec->secsym) + strsym->sec->secsym->status = SAME; + if (strsym->sec->rela) + strsym->sec->rela->status = SAME; + } + } + } + log_debug("\n"); + continue; + } + log_normal("ignoring function: %s\n", rela->sym->name); if (rela->sym->status != CHANGED) log_normal("NOTICE: no change detected in function %s, unnecessary KPATCH_IGNORE_FUNCTION()?\n", rela->sym->name); -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |