1 Star 0 Fork 41

几何途行 / kpatch

forked from src-openEuler / kpatch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0027-create-build-diff-support-for-.cold-functions-with-n.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
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
1
https://gitee.com/elimuzi/kpatch.git
git@gitee.com:elimuzi/kpatch.git
elimuzi
kpatch
kpatch
master

搜索帮助