From 8703a8f660a4787c67dd427a37d0a4df3cac60e0 Mon Sep 17 00:00:00 2001 From: jinzhiguang Date: Sun, 28 Apr 2024 13:53:44 +0800 Subject: [PATCH] backport patche from upstream backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch Signed-off-by: jinzhiguang --- ...e-function-name-in-libbpf.c-to-match.patch | 30 +++++++++++++++++++ libbpf.spec | 7 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch diff --git a/backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch b/backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch new file mode 100644 index 0000000..7402d1c --- /dev/null +++ b/backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch @@ -0,0 +1,30 @@ +From e399146fd1e0fd033be8d54da0bf7b621d5379a6 Mon Sep 17 00:00:00 2001 +From: jinzhiguang +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 +--- + 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 + diff --git a/libbpf.spec b/libbpf.spec index 90c6eca..22d3537 100644 --- a/libbpf.spec +++ b/libbpf.spec @@ -4,7 +4,7 @@ Name: %{githubname} Version: %{githubver} -Release: 13 +Release: 14 Summary: Libbpf library License: LGPLv2 or BSD @@ -42,6 +42,7 @@ Patch0025: backport-libbpf-make-RINGBUF-map-size-adjustments-more-eagerly.p Patch0026: backport-libbpf-Initialize-err-in-probe_map_create.patch Patch0027: backport-libbpf-Fix-str_has_sfxs-return-value.patch Patch0028: backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch +Patch0029: 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 @@ -94,6 +95,10 @@ developing applications that use %{name} %{_libdir}/libbpf.a %changelog +* Sun Apr 28 2024 jinzhiguang - 2:0.8.1-14 +- backport patch from upstream: + backport-libbpf-Modify-the-function-name-in-libbpf.c-to-match.patch + * Mon Apr 15 2024 zhangmingyi 2:0.8.1-13 - backport patches from upstream: backport-libbpf-Fix-NULL-pointer-dereference-in_bpf_object__c.patch -- Gitee