!128 [sync] PR-127: 回合补丁,修复libbpf.so未导出bpf_program__pin_instance符号的问题

From: @openeuler-sync-bot 
Reviewed-by: @nlgwcy 
Signed-off-by: @nlgwcy
This commit is contained in:
openeuler-ci-bot 2024-05-09 01:48:38 +00:00 committed by Gitee
commit 18044d588a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From e399146fd1e0fd033be8d54da0bf7b621d5379a6 Mon Sep 17 00:00:00 2001
From: jinzhiguang <jinzhiguang@kylinos.cn>
Date: Wed, 3 Apr 2024 17:07:36 +0800
Subject: [PATCH 1/3] libbpf: Modify the function name in libbpf.c, to match
the symbols in the libbpf.map file
Change the function name bpf_object__pin_instance to bpf_program__pin_instance,
so that the symbol can be found in the .so file.
Signed-off-by: jinzhiguang <jinzhiguang@kylinos.cn>
---
src/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libbpf.c b/src/libbpf.c
index ef7f302..4df5147 100644
--- a/src/libbpf.c
+++ b/src/libbpf.c
@@ -8047,7 +8047,7 @@ static int bpf_program_unpin_instance(struct bpf_program *prog, const char *path
}
__attribute__((alias("bpf_program_pin_instance")))
-int bpf_object__pin_instance(struct bpf_program *prog, const char *path, int instance);
+int bpf_program__pin_instance(struct bpf_program *prog, const char *path, int instance);
__attribute__((alias("bpf_program_unpin_instance")))
int bpf_program__unpin_instance(struct bpf_program *prog, const char *path, int instance);
--
2.27.0

View File

@ -4,7 +4,7 @@
Name: %{githubname}
Version: %{githubver}
Release: 12
Release: 13
Summary: Libbpf library
License: LGPLv2 or BSD
@ -41,6 +41,7 @@ Patch0024: backport-libbpf-make-RINGBUF-map-size-adjustments-more-eagerly.p
Patch0025: backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch
Patch0026: backport-libbpf-Fix-str_has_sfxs-return-value.patch
Patch0027: backport-libbpf-Initialize-err-in-probe_map_create.patch
Patch0028: backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
# This package supersedes libbpf from kernel-tools,
# which has default Epoch: 0. By having Epoch: 1
@ -93,6 +94,10 @@ developing applications that use %{name}
%{_libdir}/libbpf.a
%changelog
* Sun Apr 28 2024 jinzhiguang <jinzhiguang@kylinos.cn> - 2:0.8.1-13
- backport patch from upstream:
backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch
* Mon Apr 15 2024 zhangmingyi <zhangmingyi5@huawei.com> 2:0.8.1-12
- backport patches from upstream:
backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch