]> git.baikalelectronics.ru Git - kernel.git/commit
net: bpf: only build bpf_jit_binary_{alloc, free}() when jit selected
authorDaniel Borkmann <dborkman@redhat.com>
Wed, 10 Sep 2014 13:01:02 +0000 (15:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2014 21:05:07 +0000 (14:05 -0700)
commitdbcb50342e789a18bc6555b7dded4befa4ce2949
tree0a419ab76ac8abbc459472b7c5b79800bc3cdc45
parent1fd7f7560ed2a325c35a6f234f285845c1149fac
net: bpf: only build bpf_jit_binary_{alloc, free}() when jit selected

Since BPF JIT depends on the availability of module_alloc() and
module_free() helpers (HAVE_BPF_JIT and MODULES), we better build
that code only in case we have BPF_JIT in our config enabled, just
like with other JIT code. Fixes builds for arm/marzen_defconfig
and sh/rsk7269_defconfig.

====================
kernel/built-in.o: In function `bpf_jit_binary_alloc':
/home/cwang/linux/kernel/bpf/core.c:144: undefined reference to `module_alloc'
kernel/built-in.o: In function `bpf_jit_binary_free':
/home/cwang/linux/kernel/bpf/core.c:164: undefined reference to `module_free'
make: *** [vmlinux] Error 1
====================

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Fixes: cf8a51ffc8f0 ("net: bpf: consolidate JIT binary allocator")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
kernel/bpf/core.c