kernel-hacking-2024-linux-s.../tools/bpf/bpftool
Andrii Nakryiko d80b2fcbe0 bpftool: Add gen object command to perform BPF static linking
Add `bpftool gen object <output-file> <input_file>...` command to statically
link multiple BPF ELF object files into a single output BPF ELF object file.

This patch also updates bash completions and man page. Man page gets a short
section on `gen object` command, but also updates the skeleton example to show
off workflow for BPF application with two .bpf.c files, compiled individually
with Clang, then resulting object files are linked together with `gen object`,
and then final object file is used to generate usable BPF skeleton. This
should help new users understand realistic workflow w.r.t. compiling
mutli-file BPF application.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20210318194036.3521577-10-andrii@kernel.org
2021-03-18 16:14:23 -07:00
..
bash-completion bpftool: Add gen object command to perform BPF static linking 2021-03-18 16:14:23 -07:00
Documentation bpftool: Add gen object command to perform BPF static linking 2021-03-18 16:14:23 -07:00
skeleton
.gitignore tools/bpf: Remove bpf-helpers from bpftool docs 2021-03-04 18:39:45 -08:00
btf.c bpftool: Fix maybe-uninitialized warnings 2021-03-16 12:26:49 -07:00
btf_dumper.c tools/bpftool: Add BTF_KIND_FLOAT support 2021-03-04 17:58:15 -08:00
cfg.c
cfg.h
cgroup.c
common.c
feature.c bpf: Add kernel/modules BTF presence checks to bpftool feature command 2021-02-24 17:24:37 +01:00
gen.c bpftool: Add gen object command to perform BPF static linking 2021-03-18 16:14:23 -07:00
iter.c
jit_disasm.c
json_writer.c
json_writer.h
link.c
main.c bpftool: Fix maybe-uninitialized warnings 2021-03-16 12:26:49 -07:00
main.h
Makefile New features: 2021-02-22 13:59:43 -08:00
map.c bpftool: Fix maybe-uninitialized warnings 2021-03-16 12:26:49 -07:00
map_perf_ring.c
net.c
netlink_dumper.c
netlink_dumper.h
perf.c
pids.c
prog.c bpf: Count the number of times recursion was prevented 2021-02-11 16:19:20 +01:00
struct_ops.c
tracelog.c
xlated_dumper.c bpftool: Print subprog address properly 2021-02-26 13:23:53 -08:00
xlated_dumper.h