3 # SPDX-License-Identifier: BSD-3-Clause
8 ROOTDIR=$(readlink -f $(dirname $(readlink -f $0))/..)
9 LIST_SYMBOL=$ROOTDIR/buildtools/map-list-symbol.sh
10 CHECK_SYMBOL_MAPS=$ROOTDIR/devtools/check-symbol-maps.sh
12 # added check for "make -C test/" usage
13 if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
23 DUMPFILE=$(mktemp -t dpdk.${0##*/}.objdump.XXXXXX)
24 trap 'rm -f "$DUMPFILE"' EXIT
25 objdump -t $OBJFILE >$DUMPFILE
29 if ! $CHECK_SYMBOL_MAPS $MAPFILE; then
33 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
35 if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
36 ! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE &&
37 $LIST_SYMBOL -s $SYM $MAPFILE | grep -q EXPERIMENTAL
39 cat >&2 <<- END_OF_MESSAGE
40 $SYM is not flagged as experimental
41 but is listed in version map
42 Please add __rte_experimental to the definition of $SYM
48 # Filter out symbols suffixed with a . for icc
50 if ($2 != "l" && $4 == ".text.experimental" && !($NF ~ /\.$/)) {
55 $LIST_SYMBOL -S EXPERIMENTAL -s $SYM -q $MAPFILE || {
56 cat >&2 <<- END_OF_MESSAGE
57 $SYM is flagged as experimental
58 but is not listed in version map
59 Please add $SYM to the version map
65 for SYM in `$LIST_SYMBOL -S INTERNAL $MAPFILE |cut -d ' ' -f 3`
67 if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
68 ! grep -q "\.text\.internal.*[[:space:]]$SYM$" $DUMPFILE
70 cat >&2 <<- END_OF_MESSAGE
71 $SYM is not flagged as internal
72 but is listed in version map
73 Please add __rte_internal to the definition of $SYM
79 # Filter out symbols suffixed with a . for icc
81 if ($2 != "l" && $4 == ".text.internal" && !($NF ~ /\.$/)) {
86 $LIST_SYMBOL -S INTERNAL -s $SYM -q $MAPFILE || {
87 cat >&2 <<- END_OF_MESSAGE
88 $SYM is flagged as internal
89 but is not listed in version map
90 Please add $SYM to the version map