From: Artem Savkov Date: Thu, 4 Mar 2021 11:47:43 +0000 (+0100) Subject: create-build-diff: support for .cold functions with no id suffix X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=HEAD;p=livepatch-build-tools.git create-build-diff: support for .cold functions with no id suffix create-build-diff expects .cold functions to be suffixed by an id, which is not always the case. Drop the trailing '.' when searching for cold functions. Fixes: #1160 Signed-off-by: Artem Savkov Signed-off-by: Roger Pau Monné Reviewed-by: Ross Lagerwall --- diff --git a/common.c b/common.c index b46fcf5..67b9fcd 100644 --- a/common.c +++ b/common.c @@ -127,7 +127,7 @@ static int is_bundleable(struct symbol *sym) if (sym->type == STT_FUNC && !strncmp(sym->sec->name, ".text.unlikely.",15) && (!strcmp(sym->sec->name + 15, sym->name) || - (strstr(sym->name, ".cold.") && + (strstr(sym->name, ".cold") && !strncmp(sym->sec->name + 15, sym->name, strlen(sym->sec->name) - 15)))) return 1; diff --git a/create-diff-object.c b/create-diff-object.c index 8ed4a2e..7e6138b 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -347,7 +347,7 @@ static void kpatch_detect_child_functions(struct kpatch_elf *kelf) list_for_each_entry(sym, &kelf->symbols, list) { char *coldstr; - coldstr = strstr(sym->name, ".cold."); + coldstr = strstr(sym->name, ".cold"); if (coldstr != NULL) { char *pname;