mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
libbpf: Skip BTF fixup if object file has no BTF
Skip BTF fixup step when input object file is missing BTF altogether.
Fixes: 8fd27bf69b
("libbpf: Add BPF static linker BTF and BTF.ext support")
Reported-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/bpf/20210319205909.1748642-3-andrii@kernel.org
This commit is contained in:
parent
9ef05281e5
commit
78b226d481
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue