summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/main.c
diff options
context:
space:
mode:
authorStanislav Fomichev2018-11-12 22:44:10 +0100
committerAlexei Starovoitov2018-11-17 05:45:01 +0100
commit29a9c10e4110e368443f0b606d71557edee7f2cc (patch)
tree0c3025388dcfa6221044a9ad532775ff30bf077b /tools/bpf/bpftool/main.c
parentMerge branch 'socket-lookup-cg_sock' (diff)
downloadkernel-qcow2-linux-29a9c10e4110e368443f0b606d71557edee7f2cc.tar.gz
kernel-qcow2-linux-29a9c10e4110e368443f0b606d71557edee7f2cc.tar.xz
kernel-qcow2-linux-29a9c10e4110e368443f0b606d71557edee7f2cc.zip
bpftool: make libbfd optional
Make it possible to build bpftool without libbfd. libbfd and libopcodes are typically provided in dev/dbg packages (binutils-dev in debian) which we usually don't have installed on the fleet machines and we'd like a way to have bpftool version that works without installing any additional packages. This excludes support for disassembling jit-ted code and prints an error if the user tries to use these features. Tested by: cat > FEATURES_DUMP.bpftool <<EOF feature-libbfd=0 feature-disassembler-four-args=1 feature-reallocarray=0 feature-libelf=1 feature-libelf-mmap=1 feature-bpf=1 EOF FEATURES_DUMP=$PWD/FEATURES_DUMP.bpftool make ldd bpftool | grep libbfd Signed-off-by: Stanislav Fomichev <sdf@google.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/bpf/bpftool/main.c')
-rw-r--r--tools/bpf/bpftool/main.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index 75a3296dc0bc..5c4c1cd5a7ba 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -31,7 +31,6 @@
* SOFTWARE.
*/
-#include <bfd.h>
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
@@ -399,8 +398,6 @@ int main(int argc, char **argv)
if (argc < 0)
usage();
- bfd_init();
-
ret = cmd_select(cmds, argc, argv, do_help);
if (json_output)