f-stack/dpdk/buildtools/check-experimental-syms.sh

58 lines
1.1 KiB
Bash
Raw Normal View History

2019-06-25 11:12:58 +00:00
#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
MAPFILE=$1
OBJFILE=$2
2020-06-18 16:55:50 +00:00
LIST_SYMBOL=$(dirname $(readlink -f $0))/map-list-symbol.sh
2019-06-25 11:12:58 +00:00
# added check for "make -C test/" usage
if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
then
exit 0
fi
if [ -d $MAPFILE ]
then
exit 0
fi
2022-09-02 07:34:10 +00:00
DUMPFILE=$(mktemp -t dpdk.${0##*/}.objdump.XXXXXX)
2020-06-18 16:55:50 +00:00
trap 'rm -f "$DUMPFILE"' EXIT
objdump -t $OBJFILE >$DUMPFILE
ret=0
for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
2019-06-25 11:12:58 +00:00
do
2020-06-18 16:55:50 +00:00
if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE
2019-06-25 11:12:58 +00:00
then
cat >&2 <<- END_OF_MESSAGE
$SYM is not flagged as experimental
but is listed in version map
Please add __rte_experimental to the definition of $SYM
END_OF_MESSAGE
2020-06-18 16:55:50 +00:00
ret=1
2019-06-25 11:12:58 +00:00
fi
done
2020-06-18 16:55:50 +00:00
# Filter out symbols suffixed with a . for icc
for SYM in `awk '{
if ($2 != "l" && $4 == ".text.experimental" && !($NF ~ /\.$/)) {
print $NF
}
}' $DUMPFILE`
do
$LIST_SYMBOL -S EXPERIMENTAL -s $SYM -q $MAPFILE || {
cat >&2 <<- END_OF_MESSAGE
$SYM is flagged as experimental
but is not listed in version map
Please add $SYM to the version map
END_OF_MESSAGE
ret=1
}
done
exit $ret