提交 637d2188 编写于 作者: A Andrii Nakryiko 提交者: Zheng Zengkai

libbpf: Skip BTF fixup if object file has no BTF

mainline inclusion
from mainline-5.13-rc1
commit 78b226d4
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=78b226d48106fc91628f941c66545f05273269df

-------------------------------------------------

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: NJiri Olsa <jolsa@redhat.com>
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Tested-by: NJiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/bpf/20210319205909.1748642-3-andrii@kernel.org
(cherry picked from commit 78b226d4)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 1483c0b0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册