aboutsummaryrefslogtreecommitdiff
path: root/tools/bpf/resolve_btfids/main.c
diff options
context:
space:
mode:
authorEduard Zingerman <[email protected]>2024-06-13 10:50:10 +0100
committerAndrii Nakryiko <[email protected]>2024-06-17 14:38:31 -0700
commitc86f180ffc993975fed5907a869fc9b1555d0cfb (patch)
tree1c5545c9dc0b385fc326588e4f247f6ba830cc8f /tools/bpf/resolve_btfids/main.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 <[email protected]> Signed-off-by: Alan Maguire <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/resolve_btfids/main.c')
0 files changed, 0 insertions, 0 deletions