[PATCH bpf-next 0/3] Handle no-BTF object files better

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux