Bugzilla: https://bugzilla.redhat.com/2120968
commit b82bb1ffbb9a20032853ef4e0d5b8f37c6ae7c25
Author: Andrii Nakryiko <andrii@kernel.org>
Date: Mon Apr 25 17:45:06 2022 -0700
selftests/bpf: Add CO-RE relos and SEC("?...") to linked_funcs selftests
Enhance linked_funcs selftest with two tricky features that might not
obviously work correctly together. We add CO-RE relocations to entry BPF
programs and mark those programs as non-autoloadable with SEC("?...")
annotation. This makes sure that libbpf itself handles .BTF.ext CO-RE
relocation data matching correctly for SEC("?...") programs, as well as
ensures that BPF static linker handles this correctly (this was the case
before, no changes are necessary, but it wasn't explicitly tested).
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220426004511.2691730-6-andrii@kernel.org
Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2004012
Upstream-status: RHEL only; this is a revert of a RHEL only commit
This reverts commit 7ffb8896c8.
Currently, bpf selftests are not building at all in RHEL 9. The reason is
that after the recent update to 5.14, a new reference to kfunc_call_test
appeared. But that test got deleted by the commit above. This causes the
make to abort.
The fix is easy: just revert the deletion of the selftests. They are
now building fine in RHEL 9.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
ARK kernel specific change.
Disabling test that won't compile under clang-12.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Add selftest validating various aspects of statically linking functions:
- no conflicts and correct resolution for name-conflicting static funcs;
- correct resolution of extern functions;
- correct handling of weak functions, both resolution itself and libbpf's
handling of unused weak function that "lost" (it leaves gaps in code with
no ELF symbols);
- correct handling of hidden visibility to turn global function into
"static" for the purpose of BPF verification.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210423181348.1801389-16-andrii@kernel.org