On Wed, Nov 27, 2019 at 12:07 PM Andrii Nakryiko <andriin@xxxxxx> wrote: > > Similarly to a0d7da26ce86 ("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: 393cdfbee809 ("libbpf: Support initialized global variables") > Acked-by: Yonghong Song <yhs@xxxxxx> > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> Applied. Thanks