提交 630628cb 编写于 作者: A Andrii Nakryiko 提交者: Alexei Starovoitov

libbpf: BTF is required when externs are present

BTF is required to get type information about extern variables.
Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191219002837.3074619-4-andriin@fb.com
上级 8601fd42
......@@ -1887,7 +1887,8 @@ static void bpf_object__sanitize_btf_ext(struct bpf_object *obj)
static bool bpf_object__is_btf_mandatory(const struct bpf_object *obj)
{
return obj->efile.btf_maps_shndx >= 0;
return obj->efile.btf_maps_shndx >= 0 ||
obj->nr_extern > 0;
}
static int bpf_object__init_btf(struct bpf_object *obj,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册