43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
|
|
From 55a2778284c088f4c383cf364bef18f1b5b88531 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Artem Savkov <asavkov@redhat.com>
|
||
|
|
Date: Thu, 4 Mar 2021 12:47:43 +0100
|
||
|
|
Subject: [PATCH] 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 <asavkov@redhat.com>
|
||
|
|
---
|
||
|
|
kpatch-build/create-diff-object.c | 4 ++--
|
||
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
|
||
|
|
index 6b19e1e..d20f2f1 100644
|
||
|
|
--- a/kpatch-build/create-diff-object.c
|
||
|
|
+++ b/kpatch-build/create-diff-object.c
|
||
|
|
@@ -124,7 +124,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;
|
||
|
|
|
||
|
|
@@ -248,7 +248,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.27.0
|
||
|
|
|