From 760a67e90f367cf4e114f568114acfd77eee193e Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 13 May 2021 10:34:14 +0200 Subject: [PATCH] devtools: catch symbol duplicates in version map Add a check on versioned symbol duplicates in map files. Signed-off-by: David Marchand --- devtools/check-symbol-maps.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh index 055db24472..3bf5823cba 100755 --- a/devtools/check-symbol-maps.sh +++ b/devtools/check-symbol-maps.sh @@ -34,4 +34,19 @@ if [ -n "$orphan_symbols" ] ; then ret=1 fi +find_duplicate_symbols () +{ + for map in $(find lib drivers -name '*.map') ; do + buildtools/map-list-symbol.sh $map | \ + sort | uniq -c | grep -v " 1 $map" || true + done +} + +duplicate_symbols=$(find_duplicate_symbols) +if [ -n "$duplicate_symbols" ] ; then + echo "Found duplicates in symbol map file:" + echo "$duplicate_symbols" + ret=1 +fi + exit $ret -- 2.20.1