Re: [PATCH bpf-next 4/4] selftests/bpf: Test static data relocation

2019-02-13 Thread Alexei Starovoitov
On Tue, Feb 12, 2019 at 12:43:21PM -0800, Joe Stringer wrote: > > Do you see any value in having incremental support in libbpf that > could be used as a fallback for older kernels like in patch #2 of this > series? I could imagine libbpf probing kernel support for > global/static variables and att

Re: [PATCH bpf-next 4/4] selftests/bpf: Test static data relocation

2019-02-12 Thread Joe Stringer
On Mon, Feb 11, 2019 at 9:01 PM Alexei Starovoitov wrote: > > On Mon, Feb 11, 2019 at 04:47:29PM -0800, Joe Stringer wrote: > > Add tests for libbpf relocation of static variable references into the > > .data and .bss sections of the ELF. > > > > Signed-off-by: Joe Stringer > ... > > +#define __f

Re: [PATCH bpf-next 4/4] selftests/bpf: Test static data relocation

2019-02-11 Thread Alexei Starovoitov
On Mon, Feb 11, 2019 at 04:47:29PM -0800, Joe Stringer wrote: > Add tests for libbpf relocation of static variable references into the > .data and .bss sections of the ELF. > > Signed-off-by: Joe Stringer ... > +#define __fetch(x) (__u32)(&(x)) > + > +static __u32 static_bss = 0; /* Reloc referen

[PATCH bpf-next 4/4] selftests/bpf: Test static data relocation

2019-02-11 Thread Joe Stringer
Add tests for libbpf relocation of static variable references into the .data and .bss sections of the ELF. Signed-off-by: Joe Stringer --- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/test_progs.c | 44 + .../selftests/bpf/test_static_da