libbpf: Skip well-known ELF sections when iterating ELF
authorAndrii Nakryiko <andriin@fb.com>
Thu, 20 Aug 2020 23:12:38 +0000 (16:12 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 21 Aug 2020 22:40:22 +0000 (15:40 -0700)
commit50e09460d9f8dee9fbaaa3194c7921753d75cd96
tree32f091aebdcbf0f28defd547e508a4daac7aaa43
parent819c23af561c4dc8c35faaacacdfa9ba81bacf5f
libbpf: Skip well-known ELF sections when iterating ELF

Skip and don't log ELF sections that libbpf knows about and ignores during ELF
processing. This allows to not unnecessarily log details about those ELF
sections and cleans up libbpf debug log. Ignored sections include DWARF data,
string table, empty .text section and few special (e.g., .llvm_addrsig)
useless sections.

With such ELF sections out of the way, log unrecognized ELF sections at
pr_info level to increase visibility.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200820231250.1293069-5-andriin@fb.com
tools/lib/bpf/libbpf.c