tmp_suning_uos_patched/tools/lib/bpf
Wang Nan cc4228d57c bpf tools: Check endianness and make libbpf fail early
Check endianness according to EHDR. Code is taken from
tools/perf/util/symbol-elf.c.

Libbpf doesn't magically convert missmatched endianness. Even if we swap
eBPF instructions to correct byte order, we are unable to deal with
endianness in code logical generated by LLVM.

Therefore, libbpf should simply reject missmatched ELF object, and let
LLVM to create good code.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1435716878-189507-8-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-08-07 10:16:56 -03:00
..
.gitignore bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00
Build bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00
libbpf.c bpf tools: Check endianness and make libbpf fail early 2015-08-07 10:16:56 -03:00
libbpf.h bpf tools: Read eBPF object from buffer 2015-08-07 10:16:56 -03:00
Makefile bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00