WSL2-Linux-Kernel/tools
Andrii Nakryiko 049a44dfd6 libbpf: Don't error out on CO-RE relos for overriden weak subprogs
[ Upstream commit e89d57d938 ]

During BPF static linking, all the ELF relocations and .BTF.ext
information (including CO-RE relocations) are preserved for __weak
subprograms that were logically overriden by either previous weak
subprogram instance or by corresponding "strong" (non-weak) subprogram.
This is just how native user-space linkers work, nothing new.

But libbpf is over-zealous when processing CO-RE relocation to error out
when CO-RE relocation belonging to such eliminated weak subprogram is
encountered. Instead of erroring out on this expected situation, log
debug-level message and skip the relocation.

Fixes: db2b8b0642 ("libbpf: Support CO-RE relocations for multi-prog sections")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220408181425.2287230-2-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:22:46 +02:00
..
accounting
arch tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' 2022-05-15 20:18:51 +02:00
bootconfig
bpf bpftool: Fix the error when lookup in no-btf maps 2022-04-08 14:23:31 +02:00
build perf build: Fix check for btf__load_from_kernel_by_id() in libbpf 2022-05-25 09:57:34 +02:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include bpf: Fix comment for helper bpf_current_task_under_cgroup() 2022-04-08 14:24:14 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Don't error out on CO-RE relos for overriden weak subprogs 2022-06-09 10:22:46 +02:00
memory-model
objtool objtool: Fix SLS validation for kcov tail-call replacement 2022-05-15 20:18:51 +02:00
pci
pcmcia
perf perf bench numa: Address compiler error on s390 2022-05-25 09:57:34 +02:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-09 10:22:32 +02:00
rcu
scripts
spi
testing selftests/bpf: fix btf_dump/btf_dump due to recent clang change 2022-06-09 10:22:40 +02:00
thermal/tmon
time
tracing
usb
virtio tools/virtio: compile with -pthread 2022-05-25 09:57:25 +02:00
vm
wmi
Makefile