OSDN Git Service

tools: libbpf: don't return '.text' as a program for multi-function programs
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 28 Jun 2018 21:41:39 +0000 (14:41 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 30 Jun 2018 23:01:50 +0000 (01:01 +0200)
commiteac7d84519a35fc9fc8071b7d93803b2b075e2a7
treea2ec02eaf7ad4a704a9c6fa78535a8b8a9e5e19a
parent9a94f277c4fb84815f450418d37bfc568d57b5cc
tools: libbpf: don't return '.text' as a program for multi-function programs

Make bpf_program__next() skip over '.text' section if object file
has pseudo calls.  The '.text' section is hardly a program in that
case, it's more of a storage for code of functions other than main.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c