From: Jiri Olsa <jolsa@redhat.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
daniel@iogearbox.net, kernel-team@fb.com
Subject: Re: [PATCH bpf-next 2/3] libbpf: skip BTF fixup if object file has no BTF
Date: Fri, 19 Mar 2021 22:25:26 +0100 [thread overview]
Message-ID: <YFUWxkbBjgSgwE3t@krava> (raw)
In-Reply-To: <20210319205909.1748642-3-andrii@kernel.org>
On Fri, Mar 19, 2021 at 01:59:08PM -0700, Andrii Nakryiko wrote:
> Skip BTF fixup step when input object file is missing BTF altogether.
>
> Reported-by: Jiri Olsa <jolsa@redhat.com>
> Fixes: 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Jiri Olsa <jolsa@redhat.com>
thanks for the quick fix,
jirka
> ---
> tools/lib/bpf/linker.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> 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;
> --
> 2.30.2
>
next prev parent reply other threads:[~2021-03-19 21:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 20:59 [PATCH bpf-next 0/3] Handle no-BTF object files better Andrii Nakryiko
2021-03-19 20:59 ` [PATCH bpf-next 1/3] bpftool: improve skeleton generation for objects without BTF Andrii Nakryiko
2021-03-19 20:59 ` [PATCH bpf-next 2/3] libbpf: skip BTF fixup if object file has no BTF Andrii Nakryiko
2021-03-19 21:25 ` Jiri Olsa [this message]
2021-03-19 20:59 ` [PATCH bpf-next 3/3] selftests/bpf: allow compiling BPF objects without BTF Andrii Nakryiko
2021-03-20 2:21 ` Alexei Starovoitov
2021-03-20 17:00 ` Andrii Nakryiko
2021-03-22 1:07 ` Alexei Starovoitov
2021-03-22 16:56 ` Andrii Nakryiko
2021-03-22 17:54 ` Alexei Starovoitov
2021-03-26 16:44 ` Andrii Nakryiko
2021-03-29 1:16 ` Alexei Starovoitov
2021-03-29 6:09 ` Andrii Nakryiko
2021-03-29 18:55 ` Alexei Starovoitov
2021-03-30 18:00 ` Andrii Nakryiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YFUWxkbBjgSgwE3t@krava \
--to=jolsa@redhat.com \
--cc=andrii@kernel.org \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).