Re: [PATCH bpf-next v4 7/8] selftests/bpf: Run resolve_btfids only for relevant .test.o objects

Eduard Zingerman
2025-12-18T21:05:07Z

On Wed, 2025-12-17 at 16:33 -0800, Ihor Solodrai wrote:
> A selftest targeting resolve_btfids functionality relies on a resolved
> .BTF_ids section to be available in the TRUNNER_BINARY. The underlying
> BTF data is taken from a special BPF program (btf_data.c), and so
> resolve_btfids is executed as a part of a TRUNNER_BINARY build recipe
> on the final binary.
>
> Subsequent patches in this series allow resolve_btfids to modify BTF
> before resolving the symbols, which means that the test needs access
> to that modified BTF [1]. Currently the test simply reads in
> btf_data.bpf.o on the assumption that BTF hasn't changed.
>
> Implement resolve_btfids call only for particular test objects (just
> resolve_btfids.test.o for now). The test objects are linked into the
> TRUNNER_BINARY, and so .BTF_ids section will be available there.
>
> This will make it trivial for the resolve_btfids test to access BTF
> modified by resolve_btfids.
>
> [1] https://lore.kernel.org/bpf/CAErzpmvsgSDe-QcWH8SFFErL6y3p3zrqNri5-UHJ9iK2ChyiBw@mail.gmail.com/
>
> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> ---

Acked-by: Eduard Zingerman <eddyz87@gmail.com> …