From edefe626d097f48c1e6af6c3aac349cc3d6c48da Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Fri, 7 Aug 2026 05:37:05 +0530 Subject: [PATCH] Tests: Use a real program section in return, var_rval and if These three declared @section("sometag1"), which is not a section name libbpf can map to a program type: libbpf: failed to guess program type from ELF section 'sometag1' so they were rejected before the kernel verifier ever saw them. They generate IR and compile fine; only the section was wrong. Switch to tracepoint/syscalls/sys_enter_execve, matching the other tracepoint tests. Co-Authored-By: Claude Opus 5 (1M context) --- tests/failing_tests/if.py | 2 +- tests/passing_tests/return.py | 2 +- tests/passing_tests/var_rval.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/failing_tests/if.py b/tests/failing_tests/if.py index 638c2ce..8949d25 100644 --- a/tests/failing_tests/if.py +++ b/tests/failing_tests/if.py @@ -3,7 +3,7 @@ from ctypes import c_void_p, c_int64 @bpf -@section("sometag1") +@section("tracepoint/syscalls/sys_enter_execve") def sometag(ctx: c_void_p) -> c_int64: if 3 + 2 == 5: return c_int64(5) diff --git a/tests/passing_tests/return.py b/tests/passing_tests/return.py index 9bd048b..67a0bb0 100644 --- a/tests/passing_tests/return.py +++ b/tests/passing_tests/return.py @@ -3,7 +3,7 @@ from ctypes import c_void_p, c_int64 @bpf -@section("sometag1") +@section("tracepoint/syscalls/sys_enter_execve") def sometag(ctx: c_void_p) -> c_int64: return c_int64(1 - 1) diff --git a/tests/passing_tests/var_rval.py b/tests/passing_tests/var_rval.py index ee1735e..0742c04 100644 --- a/tests/passing_tests/var_rval.py +++ b/tests/passing_tests/var_rval.py @@ -5,7 +5,7 @@ from ctypes import c_void_p, c_int64 @bpf -@section("sometag1") +@section("tracepoint/syscalls/sys_enter_execve") def sometag(ctx: c_void_p) -> c_int64: a = 1 - 1 return c_int64(a)