diff mbox series

[7/7] create-build-diff: support for .cold functions with no id suffix

Message ID 20250116175214.83742-8-roger.pau@citrix.com (mailing list archive)
State New
Headers show
Series livepatch-build-tools: fixes for handling .cold and .hot sections | expand

Commit Message

Roger Pau Monné Jan. 16, 2025, 5:52 p.m. UTC
From: Artem Savkov <asavkov@redhat.com>

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 <asavkov@redhat.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 common.c             | 2 +-
 create-diff-object.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/common.c b/common.c
index b46fcf5cb6ca..67b9fcdb0ada 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 6060a73555ed..19590fc0fce1 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;