From 56a3a75adb4f1e11273ef5f2f13a82a2f3e93a07 Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Thu, 4 Mar 2021 12:47:43 +0100 Subject: [PATCH] create-build-diff: support for .cold functions with no id suffix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- common.c | 2 +- create-diff-object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5