Fix .rela.init.text section changed due to __BTF_id_ changed

This commit is contained in:
yixiangzhike 2025-03-18 15:06:46 +08:00
parent b94cbbdf8e
commit 38fc564e3e
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From a79ebac2bf9e1d9e01b8641f1139c5b812a846d6 Mon Sep 17 00:00:00 2001
From: caixiaomeng <caixiaomeng2@huawei.com>
Date: Fri, 28 Feb 2025 09:47:06 +0800
Subject: [PATCH] fix rela.init.text section changed due to __BTF_id_ symbol
changed
---
kpatch-build/create-diff-object.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
index d5126f8..2dceef9 100644
--- a/kpatch-build/create-diff-object.c
+++ b/kpatch-build/create-diff-object.c
@@ -428,7 +428,7 @@ static int kpatch_mangled_strcmp(char *s1, char *s2)
if (strstr(s1, ".str1."))
return strcmp(s1, s2);
- if (!strncmp(s1, "__UNIQUE_ID_", 12))
+ if (!strncmp(s1, "__UNIQUE_ID_", 12) || !strncmp(s1, "__BTF_ID_", 9))
return __kpatch_unique_id_strcmp(s1, s2);
#ifdef __riscv
--
2.33.0

View File

@ -1,7 +1,7 @@
Name: kpatch
Epoch: 1
Version: 0.9.9
Release: 10
Release: 11
Summary: A Linux dynamic kernel patching infrastructure
License: GPLv2
@ -53,6 +53,7 @@ Patch0037:0037-add-initial-riscv64-support.patch
Patch0038:0038-Fix-undefined-behavior-problem-when-using-list_forea.patch
Patch0039:0039-build-support-for-building-with-clang.patch
Patch0040:0001-add-loongarch64-support.patch
Patch0041:0051-fix-rela.init.text-section-changed-due-to-__BTF_id_-changed.patch
Patch9001:huawei-fix-function-ptr-relocation.patch
Patch9002:huawei-lookup.c-ignore-BTF-ID-when-matching-locals.patch
@ -124,6 +125,12 @@ popd
%{_mandir}/man1/*.1.gz
%changelog
* Tue Mar 18 2025 yixiangzhike <yixiangzhike007@163.com> - 1:0.9.9-11
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix .rela.init.text section changed due to __BTF_id_ changed
* Mon Jan 13 2025 caixiaomeng <caixiaomeng2@huawei.com> - 1:0.9.9-10
- Type:bugfix
- CVE:NA