bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] Handle no-BTF object files better
@ 2021-03-19 20:59 Andrii Nakryiko
  2021-03-19 20:59 ` [PATCH bpf-next 1/3] bpftool: improve skeleton generation for objects without BTF Andrii Nakryiko
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Andrii Nakryiko @ 2021-03-19 20:59 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii, kernel-team

Fix two issues caused by BPF object files with missing BTF type information:
  1. BPF skeleton generated for BPF object files that use global variables but
     are compiled without BTF won't compile.
  2. BPF static linker will crash attempting to fix up BTF for input object
     file with no BTF.

This patch set also extends static linking selftest to validate correct
handling of both conditions now. For that, selftests Makefile is enhanced to
allow selecting whether a given BPF object file should be compiled with BTF or
not, based on naming convention (.nobtf.c suffix).

Andrii Nakryiko (3):
  bpftool: improve skeleton generation for objects without BTF
  libbpf: skip BTF fixup if object file has no BTF
  selftests/bpf: allow compiling BPF objects without BTF

 tools/bpf/bpftool/gen.c                       | 81 +++++++++++++++----
 tools/lib/bpf/linker.c                        |  3 +
 tools/testing/selftests/bpf/Makefile          | 21 +++--
 .../selftests/bpf/prog_tests/static_linked.c  |  6 +-
 .../bpf/progs/test_static_linked3.nobtf.c     | 36 +++++++++
 5 files changed, 123 insertions(+), 24 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/test_static_linked3.nobtf.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-30 18:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).