Skip to content
Snippets Groups Projects
Commit 78b226d4 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov
Browse files

libbpf: Skip BTF fixup if object file has no BTF


Skip BTF fixup step when input object file is missing BTF altogether.

Fixes: 8fd27bf6 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Reported-by: default avatarJiri Olsa <jolsa@redhat.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/bpf/20210319205909.1748642-3-andrii@kernel.org
parent 9ef05281
No related branches found
No related tags found
No related merge requests found
......@@ -1313,6 +1313,9 @@ static int linker_fixup_btf(struct src_obj *obj)
struct src_sec *sec;
int i, j, n, m;
if (!obj->btf)
return 0;
n = btf__get_nr_types(obj->btf);
for (i = 1; i <= n; i++) {
struct btf_var_secinfo *vi;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment