diff options
| author | Andrii Nakryiko <[email protected]> | 2021-03-19 20:59:08 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-03-23 01:58:25 +0000 |
| commit | 78b226d48106fc91628f941c66545f05273269df (patch) | |
| tree | 52e4f693d2c4941ce8d004b8b92c063b295eb64a /tools/lib/bpf/linker.c | |
| parent | bpf: Remove insn_buf[] declaration in inner block (diff) | |
| download | kernel-78b226d48106fc91628f941c66545f05273269df.tar.gz kernel-78b226d48106fc91628f941c66545f05273269df.zip | |
libbpf: Skip BTF fixup if object file has no BTF
Skip BTF fixup step when input object file is missing BTF altogether.
Fixes: 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Reported-by: Jiri Olsa <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Tested-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/linker.c')
| -rw-r--r-- | tools/lib/bpf/linker.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index b4fff912dce2..5e0aa2f2c0ca 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -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; |
