Skip to content

Commit

Permalink
bpf: Fix test_obj_id.c for llvm 5.0
Browse files Browse the repository at this point in the history
llvm 5.0 does not like the section name and the function name
to be the same:

clang -I. -I./include/uapi -I../../../include/uapi \
	-I../../../../samples/bpf/ \
	-Wno-compare-distinct-pointer-types \
	-O2 -target bpf -c \
	linux/tools/testing/selftests/bpf/test_obj_id.c -o \
	linux/tools/testing/selftests/bpf/test_obj_id.o
fatal error: error in backend: 'test_prog_id' label emitted multiple times to
assembly file
clang-5.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 5.0.0 (trunk 304326) (llvm/trunk 304329)

This patch makes changes to the section name and the function name.

Fixes: 95b9afd ("bpf: Test for bpf ID")
Reported-by: Alexei Starovoitov <ast@fb.com>
Reported-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Martin KaFai Lau authored and David S. Miller committed Jun 9, 2017
1 parent fad0743 commit a2e8bbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/test_obj_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct bpf_map_def SEC("maps") test_map_id = {
.max_entries = 1,
};

SEC("test_prog_id")
int test_prog_id(struct __sk_buff *skb)
SEC("test_obj_id_dummy")
int test_obj_id(struct __sk_buff *skb)
{
__u32 key = 0;
__u64 *value;
Expand Down

0 comments on commit a2e8bbd

Please sign in to comment.