From: Mark Wielaard Date: Mon, 5 Sep 2016 09:15:50 +0000 (+0200) Subject: libcpu: Fix build of bpf_disasm.c for kernels < 3.20. X-Git-Tag: elfutils-0.168~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f7b5ba9624489b5a2f714569c29ef865d4dcd6f;p=thirdparty%2Felfutils.git libcpu: Fix build of bpf_disasm.c for kernels < 3.20. Before linux 3.20 the BPF_PSEUDO_MAP_FD constant wasn't defined. Reported-by: Julian Ospald Signed-off-by: Mark Wielaard --- diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index 9f3566c02..9cce4e726 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLog @@ -1,3 +1,7 @@ +2016-09-05 Mark Wielaard + + * bpf_disasm.c: Define BPF_PSEUDO_MAP_FD if undefined. + 2016-08-10 Richard Henderson * bpf_disasm.c (bpf_disasm): Rearrange the printing of instructions diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c index 153dba9d2..e4bbae4a8 100644 --- a/libcpu/bpf_disasm.c +++ b/libcpu/bpf_disasm.c @@ -40,6 +40,10 @@ #include "../libelf/common.h" #include "../libebl/libeblP.h" +/* BPF_PSEUDO_MAP_FD was only introduced in linux 3.20. */ +#ifndef BPF_PSEUDO_MAP_FD + #define BPF_PSEUDO_MAP_FD 1 +#endif static const char class_string[8][8] = { [BPF_LD] = "ld",