0b223644dcf867a18a3415025e5e25f8f2e9f5a3
[openwrt/staging/neocturne.git] /
1 From fafb2e7eaec6d33ce16e28f481edf781219d5d27 Mon Sep 17 00:00:00 2001
2 From: Tony Ambardar <Tony.Ambardar@gmail.com>
3 Date: Fri, 24 Jul 2020 23:58:17 -0700
4 Subject: [PATCH] tools/libbpf: ensure no local symbols counted in ABI check
5
6 This avoids finding versioned local symbols such as _init and _fini in
7 the libbpf.so file.
8
9 Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
10 ---
11 tools/lib/bpf/Makefile | 2 ++
12 1 file changed, 2 insertions(+)
13
14 diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
15 index bf8ed134cb8a..c820b0be9d63 100644
16 --- a/tools/lib/bpf/Makefile
17 +++ b/tools/lib/bpf/Makefile
18 @@ -152,6 +152,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
19 awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
20 sort -u | wc -l)
21 VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
22 + awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \
23 grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
24
25 CMD_TARGETS = $(LIB_TARGET) $(PC_FILE)
26 @@ -219,6 +220,7 @@ check_abi: $(OUTPUT)libbpf.so
27 awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \
28 sort -u > $(OUTPUT)libbpf_global_syms.tmp; \
29 readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
30 + awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \
31 grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | \
32 sort -u > $(OUTPUT)libbpf_versioned_syms.tmp; \
33 diff -u $(OUTPUT)libbpf_global_syms.tmp \
34 --
35 2.25.1
36