aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2024-06-13 10:50:10 +0100
committerAndrii Nakryiko <andrii@kernel.org>2024-06-17 14:38:31 -0700
commitc86f180ffc993975fed5907a869fc9b1555d0cfb (patch)
tree1c5545c9dc0b385fc326588e4f247f6ba830cc8f /tools/testing/selftests/bpf/prog_tests/bpf_iter.c
parentaffdeb50616b190c3236cc2bf116e1b931a43be2 (diff)
libbpf: Make btf_parse_elf process .BTF.base transparently
Update btf_parse_elf() to check if .BTF.base section is present. The logic is as follows: if .BTF.base section exists: distilled_base := btf_new(.BTF.base) if distilled_base: btf := btf_new(.BTF, .base_btf=distilled_base) if base_btf: btf_relocate(btf, base_btf) else: btf := btf_new(.BTF) return btf In other words: - if .BTF.base section exists, load BTF from it and use it as a base for .BTF load; - if base_btf is specified and .BTF.base section exist, relocate newly loaded .BTF against base_btf. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240613095014.357981-6-alan.maguire@oracle.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_iter.c')
0 files changed, 0 insertions, 0 deletions