This small patch set performs internal refactorings around libbpf BPF program ELF section definitions' handling. This is preparatory changes for further changes around making libbpf BPF program section handling more strict but also pluggable and customizable, as part of the libbpf 1.0 effort. See individual patches for details. Andrii Nakryiko (4): selftests/bpf: update selftests to always provide "struct_ops" SEC libbpf: ensure BPF prog types are set before relocations libbpf: simplify BPF program auto-attach code libbpf: minimize explicit iterator of section definition array tools/lib/bpf/libbpf.c | 200 ++++++++---------- tools/testing/selftests/bpf/progs/bpf_cubic.c | 12 +- 2 files changed, 95 insertions(+), 117 deletions(-) -- 2.30.2