build: remove redundant config include
[dpdk.git] / buildtools / check-experimental-syms.sh
1 #!/bin/sh
2
3 # SPDX-License-Identifier: BSD-3-Clause
4
5 MAPFILE=$1
6 OBJFILE=$2
7
8 LIST_SYMBOL=$(dirname $(readlink -f $0))/map-list-symbol.sh
9
10 # added check for "make -C test/" usage
11 if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
12 then
13         exit 0
14 fi
15
16 if [ -d $MAPFILE ]
17 then
18         exit 0
19 fi
20
21 DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
22 trap 'rm -f "$DUMPFILE"' EXIT
23 objdump -t $OBJFILE >$DUMPFILE
24
25 ret=0
26 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
27 do
28         if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
29                 ! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE
30         then
31                 cat >&2 <<- END_OF_MESSAGE
32                 $SYM is not flagged as experimental
33                 but is listed in version map
34                 Please add __rte_experimental to the definition of $SYM
35                 END_OF_MESSAGE
36                 ret=1
37         fi
38 done
39
40 # Filter out symbols suffixed with a . for icc
41 for SYM in `awk '{
42         if ($2 != "l" && $4 == ".text.experimental" && !($NF ~ /\.$/)) {
43                 print $NF
44         }
45 }' $DUMPFILE`
46 do
47         $LIST_SYMBOL -S EXPERIMENTAL -s $SYM -q $MAPFILE || {
48                 cat >&2 <<- END_OF_MESSAGE
49                 $SYM is flagged as experimental
50                 but is not listed in version map
51                 Please add $SYM to the version map
52                 END_OF_MESSAGE
53                 ret=1
54         }
55 done
56
57 exit $ret