* [PATCH bpf-next] selftests/bpf: fix compilation error of bpf_iter_task_stack.c
@ 2020-07-03 18:17 Song Liu
2020-07-03 21:30 ` Daniel Borkmann
0 siblings, 1 reply; 2+ messages in thread
From: Song Liu @ 2020-07-03 18:17 UTC (permalink / raw)
To: bpf, netdev
Cc: ast, daniel, kernel-team, john.fastabend, kpsingh, brouer, Song Liu
selftests/bpf shows compilation error as
libbpf: invalid relo for 'entries' in special section 0xfff2; forgot to
initialize global var?..
Fix it by initializing 'entries' to zeros.
Fixes: c7568114bc56 ("selftests/bpf: Add bpf_iter test with bpf_get_task_stack()")
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c b/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
index e40d32a2ed93d..65899cc71d535 100644
--- a/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
+++ b/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
@@ -7,7 +7,7 @@
char _license[] SEC("license") = "GPL";
#define MAX_STACK_TRACE_DEPTH 64
-unsigned long entries[MAX_STACK_TRACE_DEPTH];
+unsigned long entries[MAX_STACK_TRACE_DEPTH] = {0};
#define SIZE_OF_ULONG (sizeof(unsigned long))
SEC("iter/task")
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: fix compilation error of bpf_iter_task_stack.c
2020-07-03 18:17 [PATCH bpf-next] selftests/bpf: fix compilation error of bpf_iter_task_stack.c Song Liu
@ 2020-07-03 21:30 ` Daniel Borkmann
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2020-07-03 21:30 UTC (permalink / raw)
To: Song Liu, bpf, netdev; +Cc: ast, kernel-team, john.fastabend, kpsingh, brouer
On 7/3/20 8:17 PM, Song Liu wrote:
> selftests/bpf shows compilation error as
>
> libbpf: invalid relo for 'entries' in special section 0xfff2; forgot to
> initialize global var?..
>
> Fix it by initializing 'entries' to zeros.
>
> Fixes: c7568114bc56 ("selftests/bpf: Add bpf_iter test with bpf_get_task_stack()")
> Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
> Signed-off-by: Song Liu <songliubraving@fb.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-03 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 18:17 [PATCH bpf-next] selftests/bpf: fix compilation error of bpf_iter_task_stack.c Song Liu
2020-07-03 21:30 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).