]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Add BPF_EMBED_OBJ macro for embedding BPF .o files
authorAndrii Nakryiko <andriin@fb.com>
Sat, 14 Dec 2019 01:43:28 +0000 (17:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Dec 2019 23:58:04 +0000 (15:58 -0800)
commitc5e4f00e102a5adf7a1fbd0a5462edc5a16be240
tree75e7c2bb4a79b1849b9cb2fe1d4f93bbb9ca9562
parent160ce07436c8ba28792ac99a9d50dd8d5fd37c3a
libbpf: Add BPF_EMBED_OBJ macro for embedding BPF .o files

Add a convenience macro BPF_EMBED_OBJ, which allows to embed other files
(typically used to embed BPF .o files) into a hosting userspace programs. To
C program it is exposed as struct bpf_embed_data, containing a pointer to
raw data and its size in bytes.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191214014341.3442258-5-andriin@fb.com
tools/lib/bpf/libbpf.h
tools/testing/selftests/bpf/prog_tests/attach_probe.c