drivers: improve pmdinfo generation with meson
[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 if [ -d $MAPFILE ]
9 then
10         exit 0
11 fi
12
13 for i in `awk 'BEGIN {found=0}
14                 /.*EXPERIMENTAL.*/ {found=1}
15                 /.*}.*;/ {found=0}
16                 /.*;/ {if (found == 1) print $1}' $MAPFILE`
17 do
18         SYM=`echo $i | sed -e"s/;//"`
19         objdump -t $OBJFILE | grep -q "\.text.*$SYM"
20         IN_TEXT=$?
21         objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
22         IN_EXP=$?
23         if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
24         then
25                 echo "$SYM is not flagged as experimental"
26                 echo "but is listed in version map"
27                 echo "Please add __rte_experimental to the definition of $SYM"
28                 exit 1
29         fi
30 done
31 exit 0
32