linux-stable/tools
Andrii Nakryiko 53f8dd434b libbpf: Fix global variable relocation
Similarly to a0d7da26ce ("libbpf: Fix call relocation offset calculation
bug"), relocations against global variables need to take into account
referenced symbol's st_value, which holds offset into a corresponding data
section (and, subsequently, offset into internal backing map). For static
variables this offset is always zero and data offset is completely described
by respective instruction's imm field.

Convert a bunch of selftests to global variables. Previously they were relying
on `static volatile` trick to ensure Clang doesn't inline static variables,
which with global variables is not necessary anymore.

Fixes: 393cdfbee8 ("libbpf: Support initialized global variables")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20191127200651.1381348-1-andriin@fb.com
2019-11-27 16:34:21 -08:00
..
accounting
arch
bpf tools, bpf: Fix build for 'make -s tools/bpf O=<dir>' 2019-11-24 16:58:45 -08:00
build
cgroup
debugging
firewire
firmware
gpio
hv
iio
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2019-11-25 20:02:57 -08:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix global variable relocation 2019-11-27 16:34:21 -08:00
memory-model
nfsd
objtool
pci
pcmcia
perf
power
scripts
spi
testing libbpf: Fix global variable relocation 2019-11-27 16:34:21 -08:00
thermal/tmon
time
usb
virtio
vm
wmi
Makefile