libbpf: Support flexible arrays in CO-RE
authorAndrii Nakryiko <andriin@fb.com>
Sun, 15 Dec 2019 07:08:43 +0000 (23:08 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 16 Dec 2019 00:53:50 +0000 (16:53 -0800)
commit1b484b301cec404e8a329f05edf848fc0a5875c0
tree0841268af64cfe610cc4bad434f6dd7d43ebb3a9
parent01c6f7aaacf982fd80d5e855f0c6187d8155ffed
libbpf: Support flexible arrays in CO-RE

Some data stuctures in kernel are defined with either zero-sized array or
flexible (dimensionless) array at the end of a struct. Actual data of such
array follows in memory immediately after the end of that struct, forming its
variable-sized "body" of elements. Support such access pattern in CO-RE
relocation handling.

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