!129 ignore initcall5 section to adapt 6.6 kernel

From: @pshysimon 
Reviewed-by: @hubin95 
Signed-off-by: @hubin95
This commit is contained in:
openeuler-ci-bot 2024-05-24 12:36:42 +00:00 committed by Gitee
commit 7446c6970d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From bad5b93c1fa85cc4b71533284064fd0af1bab464 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 24 May 2024 14:45:55 +0800
Subject: [PATCH] ignore initcall5 section to adapt 6.6 kernel
---
kpatch-build/create-diff-object.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
index f1dfc1d..4c029ae 100644
--- a/kpatch-build/create-diff-object.c
+++ b/kpatch-build/create-diff-object.c
@@ -2035,8 +2035,12 @@ static void kpatch_include_force_elements(struct kpatch_elf *kelf)
int kpatch_include_new_static_var(struct kpatch_elf *kelf)
{
struct symbol *sym;
+ char *initcall_prefix = "__initcall__kmod";
list_for_each_entry(sym, &kelf->symbols, list) {
+ if (strncmp(sym->name, initcall_prefix, strlen(initcall_prefix)) == 0) {
+ continue;
+ }
if (sym->status == NEW &&
sym->bind == STB_LOCAL &&
(sym->type == STT_OBJECT ||
--
2.33.0

View File

@ -1,7 +1,7 @@
Name: kpatch
Epoch: 1
Version: 0.9.9
Release: 6
Release: 7
Summary: A Linux dynamic kernel patching infrastructure
License: GPLv2
@ -58,6 +58,7 @@ Patch9002:huawei-lookup.c-ignore-BTF-ID-when-matching-locals.patch
Patch9003:huawei-adapt-kpatch-to-6.6-kernel-and-fix-bundle-symbols-ch.patch
Patch9004:huawei-fix-function-ptr-relocation-and-strip-.BTF-section-f.patch
Patch9005:huawei-adapt-arm64-dynamic-ftrace-call-with-2-nops.patch
Patch9006:huawei-ignore-initcall5-section-to-adapt-6.6-kernel.patch
BuildRequires: gcc elfutils-libelf-devel kernel-devel git
%ifarch ppc64le
@ -121,6 +122,12 @@ popd
%{_mandir}/man1/*.1.gz
%changelog
* Fri May 24 2024 caixiaomeng <caixiaomeng2@huawei.com> - 1:0.9.9-7
- Type: bugfix
- CVE:NA
- SUG:NA
- DESC:ignore initcall5 section to adapt 6.6 kernel
* Wed May 22 2024 caixiaomeng <caixiaomeng2@huawei.com> - 1:0.9.9-6
- Type: bugfix
- CVE:NA