libbpf: Add BPF_PROG_BIND_MAP syscall and use it on .rodata section
authorYiFei Zhu <zhuyifei@google.com>
Tue, 15 Sep 2020 23:45:41 +0000 (16:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 16 Sep 2020 01:28:27 +0000 (18:28 -0700)
commit5d23328dccd93c47e2719cb9d2ae303c235d277d
tree9e6e301201a9a5f400125dcfa8d9cd1e9c5ec4ef
parentef15314aa5de955c6afd87d512e8b00f5ac08d06
libbpf: Add BPF_PROG_BIND_MAP syscall and use it on .rodata section

The patch adds a simple wrapper bpf_prog_bind_map around the syscall.
When the libbpf tries to load a program, it will probe the kernel for
the support of this syscall and unconditionally bind .rodata section
to the program.

Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Link: https://lore.kernel.org/bpf/20200915234543.3220146-4-sdf@google.com
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.map