2018-01-22 01:48:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
MAPFILE=$1
|
|
|
|
OBJFILE=$2
|
|
|
|
|
2019-10-08 14:36:26 +00:00
|
|
|
LIST_SYMBOL=$(dirname $(readlink -f $0))/map-list-symbol.sh
|
2019-06-29 11:58:48 +00:00
|
|
|
|
2018-11-06 14:35:01 +00:00
|
|
|
# added check for "make -C test/" usage
|
|
|
|
if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-01-22 01:48:03 +00:00
|
|
|
if [ -d $MAPFILE ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-08-12 07:02:28 +00:00
|
|
|
DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump)
|
|
|
|
trap 'rm -f "$DUMPFILE"' EXIT
|
|
|
|
objdump -t $OBJFILE >$DUMPFILE
|
|
|
|
|
2019-06-29 11:58:48 +00:00
|
|
|
ret=0
|
2019-11-25 08:10:06 +00:00
|
|
|
for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
|
2018-01-22 01:48:03 +00:00
|
|
|
do
|
2019-11-25 08:10:07 +00:00
|
|
|
if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
|
2020-05-15 15:01:53 +00:00
|
|
|
! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE &&
|
|
|
|
$LIST_SYMBOL -s $SYM $MAPFILE | grep -q EXPERIMENTAL
|
2018-01-22 01:48:03 +00:00
|
|
|
then
|
2018-02-07 08:24:00 +00:00
|
|
|
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
|
2019-06-29 11:58:48 +00:00
|
|
|
ret=1
|
2018-01-22 01:48:03 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-07-02 12:13:50 +00:00
|
|
|
# Filter out symbols suffixed with a . for icc
|
2019-08-12 07:02:28 +00:00
|
|
|
for SYM in `awk '{
|
2019-07-02 12:13:50 +00:00
|
|
|
if ($2 != "l" && $4 == ".text.experimental" && !($NF ~ /\.$/)) {
|
2019-06-29 11:58:48 +00:00
|
|
|
print $NF
|
|
|
|
}
|
2019-08-12 07:02:28 +00:00
|
|
|
}' $DUMPFILE`
|
2019-06-29 11:58:48 +00:00
|
|
|
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
|
|
|
|
|
2020-04-25 10:56:17 +00:00
|
|
|
for SYM in `$LIST_SYMBOL -S INTERNAL $MAPFILE |cut -d ' ' -f 3`
|
|
|
|
do
|
|
|
|
if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
|
|
|
|
! grep -q "\.text\.internal.*[[:space:]]$SYM$" $DUMPFILE
|
|
|
|
then
|
|
|
|
cat >&2 <<- END_OF_MESSAGE
|
|
|
|
$SYM is not flagged as internal
|
|
|
|
but is listed in version map
|
|
|
|
Please add __rte_internal to the definition of $SYM
|
|
|
|
END_OF_MESSAGE
|
|
|
|
ret=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Filter out symbols suffixed with a . for icc
|
|
|
|
for SYM in `awk '{
|
|
|
|
if ($2 != "l" && $4 == ".text.internal" && !($NF ~ /\.$/)) {
|
|
|
|
print $NF
|
|
|
|
}
|
|
|
|
}' $DUMPFILE`
|
|
|
|
do
|
|
|
|
$LIST_SYMBOL -S INTERNAL -s $SYM -q $MAPFILE || {
|
|
|
|
cat >&2 <<- END_OF_MESSAGE
|
|
|
|
$SYM is flagged as internal
|
|
|
|
but is not listed in version map
|
|
|
|
Please add $SYM to the version map
|
|
|
|
END_OF_MESSAGE
|
|
|
|
ret=1
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
2019-06-29 11:58:48 +00:00
|
|
|
exit $ret
|