diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-12-01 19:10:26 +0100 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-12-02 20:18:34 +0100 |
commit | 29db4bea1d10b73749d7992c1fc9ac13499e8871 (patch) | |
tree | 31f7d97402820d1003f9a6e21c0a2b85cafe7e4f /kernel/bpf/Makefile | |
parent | bpf: Rename btf_member accessors. (diff) | |
download | linux-29db4bea1d10b73749d7992c1fc9ac13499e8871.tar.xz linux-29db4bea1d10b73749d7992c1fc9ac13499e8871.zip |
bpf: Prepare relo_core.c for kernel duty.
Make relo_core.c to be compiled for the kernel and for user space libbpf.
Note the patch is reducing BPF_CORE_SPEC_MAX_LEN from 64 to 32.
This is the maximum number of nested structs and arrays.
For example:
struct sample {
int a;
struct {
int b[10];
};
};
struct sample *s = ...;
int *y = &s->b[5];
This field access is encoded as "0:1:0:5" and spec len is 4.
The follow up patch might bump it back to 64.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211201181040.23337-4-alexei.starovoitov@gmail.com
Diffstat (limited to 'kernel/bpf/Makefile')
-rw-r--r-- | kernel/bpf/Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile index cf6ca339f3cd..c1a9be6a4b9f 100644 --- a/kernel/bpf/Makefile +++ b/kernel/bpf/Makefile @@ -36,3 +36,7 @@ obj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o obj-${CONFIG_BPF_LSM} += bpf_lsm.o endif obj-$(CONFIG_BPF_PRELOAD) += preload/ + +obj-$(CONFIG_BPF_SYSCALL) += relo_core.o +$(obj)/relo_core.o: $(srctree)/tools/lib/bpf/relo_core.c FORCE + $(call if_changed_rule,cc_o_c) |