diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-04-25 17:45:05 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-04-26 15:41:46 -0700 |
commit | 11d5daa89254ba2233d422777d52dbf24666b280 (patch) | |
tree | 6638f5f9c8ebb217f2e207e7b1a8bebced80afd5 /tools/testing/selftests/bpf/prog_tests/linked_funcs.c | |
parent | 966a7509325395c51c5f6d89e7352b0585e4804b (diff) |
libbpf: Avoid joining .BTF.ext data with BPF programs by section name
Instead of using ELF section names as a joining key between .BTF.ext and
corresponding BPF programs, pre-build .BTF.ext section number to ELF
section index mapping during bpf_object__open() and use it later for
matching .BTF.ext information (func/line info or CO-RE relocations) to
their respective BPF programs and subprograms.
This simplifies corresponding joining logic and let's libbpf do
manipulations with BPF program's ELF sections like dropping leading '?'
character for non-autoloaded programs. Original joining logic in
bpf_object__relocate_core() (see relevant comment that's now removed)
was never elegant, so it's a good improvement regardless. But it also
avoids unnecessary internal assumptions about preserving original ELF
section name as BPF program's section name (which was broken when
SEC("?abc") support was added).
Fixes: a3820c481112 ("libbpf: Support opting out from autoloading BPF programs declaratively")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220426004511.2691730-5-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/linked_funcs.c')
0 files changed, 0 insertions, 0 deletions