Make libbpf more conservative in using BPF_F_MMAPABLE flag with internal BPF array maps that are backing global data sections. See patch #2 for full description and justification. Changes in this dataset support having bpf_spinlock, kptr, rb_tree nodes and other "special" variables as global variables. Combining this with libbpf's existing support for multiple custom .data.* sections allows BPF programs to utilize multiple spinlock/rbtree_node/kptr variables in a pretty natural way by just putting all such variables into separate data sections (and thus ARRAY maps). Andrii Nakryiko (3): libbpf: clean up and refactor BTF fixup step libbpf: only add BPF_F_MMAPABLE flag for data maps with global vars libbpf: add non-mmapable data section selftest tools/lib/bpf/libbpf.c | 176 +++++++++++------- .../selftests/bpf/prog_tests/skeleton.c | 11 +- .../selftests/bpf/progs/test_skeleton.c | 17 ++ 3 files changed, 138 insertions(+), 66 deletions(-) -- 2.30.2