2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2018 Mellanox Technologies, Ltd
7 # speed up by ignoring Unicode details
11 set -- $(find lib drivers -name '*.map')
16 find_orphan_symbols ()
19 for sym in $(sed -rn 's,^([^}]*_.*);.*$,\1,p' $map) ; do
20 if echo $sym | grep -q '^per_lcore_' ; then
21 symsrc=${sym#per_lcore_}
22 elif echo $sym | grep -q '^__rte_.*_trace_' ; then
27 if [ -z "$(grep -rlw $symsrc $(dirname $map) | grep -v $map)" ] ; then
34 orphan_symbols=$(find_orphan_symbols $@)
35 if [ -n "$orphan_symbols" ] ; then
36 echo "Found only in symbol map file:"
37 echo "$orphan_symbols" | sed 's,^,\t,'
41 find_duplicate_symbols ()
44 buildtools/map-list-symbol.sh $map | \
45 sort | uniq -c | grep -v " 1 $map" || true
49 duplicate_symbols=$(find_duplicate_symbols $@)
50 if [ -n "$duplicate_symbols" ] ; then
51 echo "Found duplicates in symbol map file:"
52 echo "$duplicate_symbols"