libbpf: identify maps by section index in addition to offset
authorAndrii Nakryiko <andriin@fb.com>
Mon, 17 Jun 2019 19:26:54 +0000 (12:26 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jun 2019 22:10:40 +0000 (00:10 +0200)
commitdb48814bd2833ee231f48bd2030082369b88f9ef
treecca3be34591c388b5859afe0d29063591142809c
parentbf82927125dd25003d76ed5541da704df21de57a
libbpf: identify maps by section index in addition to offset

To support maps to be defined in multiple sections, it's important to
identify map not just by offset within its section, but section index as
well. This patch adds tracking of section index.

For global data, we record section index of corresponding
.data/.bss/.rodata ELF section for uniformity, and thus don't need
a special value of offset for those maps.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c