libcareplus/0007-kpatch_elf-compatible-with-older-versions-of-the-so-.patch
yezengruan eda47481b9 update libcareplus to version 1.0.0-12
kpatch_process: fix possible double free.
ptrace: fix NULL pointer access problem
fix patched process crashing when acccess the global var
fix probably restore cc symbol link fail when kill patch building uncourteous
optimize: Remove unnecessary comparison code

Signed-off-by: yezengruan <yezengruan@huawei.com>
(cherry picked from commit f3d59711105eb667fa2f920958fcbdbb7068afd2)
2022-07-21 15:47:45 +08:00

50 lines
1.5 KiB
Diff

From b316ee94be9e6bdcda30400511593550de1eb29b Mon Sep 17 00:00:00 2001
From: jiang-dawei15 <jiangdawei15@huawei.com>
Date: Tue, 1 Mar 2022 16:07:37 +0800
Subject: [PATCH 1/2] kpatch_elf: compatible with older versions of the so
naming rules
New openEuler so naming rules have been changed, such as:
old so naming rules: libc-x.y.z.so
<----->
new so naming rules: libc.so.x.y.z
We need support this two version.
fix commit: abfc33435c25e1515e35768c9a2d684aa72dc780
Signed-off-by: Bihong Yu <yubihong@huawei.com>
---
src/kpatch_elf.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/kpatch_elf.c b/src/kpatch_elf.c
index 260209a..833f8e1 100644
--- a/src/kpatch_elf.c
+++ b/src/kpatch_elf.c
@@ -180,13 +180,19 @@ static int
elf_object_is_interp_exception(struct object_file *o)
{
/* libc */
- if (!strncmp(o->name, "libc.", 5))
+ if (!strncmp(o->name, "libc.so.", 8) ||
+ (!strncmp(o->name, "libc-", 5) &&
+ !strncmp(o->name + strlen(o->name) - 3, ".so", 3)))
return 1;
/* libpthread */
- if (!strncmp(o->name, "libpthread.", 11))
+ if (!strncmp(o->name, "libpthread.so.", 14) ||
+ (!strncmp(o->name, "libpthread-", 11) &&
+ !strncmp(o->name + strlen(o->name) - 3, ".so", 3)))
return 1;
/* libdl */
- if (!strncmp(o->name, "libdl.", 6))
+ if (!strncmp(o->name, "libdl.so.", 9) ||
+ (!strncmp(o->name, "libdl-", 6) &&
+ !strncmp(o->name + strlen(o->name) - 3, ".so", 3)))
return 1;
return 0;
}
--
2.27.0