libbpf: Add internal helper to load BTF data by FD

Add a btf_get_from_fd() helper, which constructs struct btf from in-kernel BTF
data by FD. This is used for loading module BTFs.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201203204634.1325171-4-andrii@kernel.org
This commit is contained in:
Andrii Nakryiko 2020-12-03 12:46:23 -08:00 • committed by Alexei Starovoitov
commit a19f93cfaf
2 changed files with 36 additions and 26 deletions