FILE
struct_ops_detach.c
File preview with syntax highlighting.
linux-6.19.14/tools/testing/selftests/bpf/progs/struct_ops_detach.c
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */ 3#include <vmlinux.h> 4#include <bpf/bpf_helpers.h> 5#include "../test_kmods/bpf_testmod.h" 6 7char _license[] SEC("license") = "GPL"; 8 9/* 10 * This subprogram validates that libbpf handles the situation in which BPF 11 * object has subprograms in .text section, but has no entry BPF programs. 12 * At some point that was causing issues due to legacy logic of treating such 13 * subprogram as entry program (with unknown program type, which would fail). 14 */ 15int dangling_subprog(void) 16{ 17 /* do nothing, just be here */ 18 return 0; 19} 20 21SEC(".struct_ops.link") 22struct bpf_testmod_ops testmod_do_detach;
~/
Read-only file preview.