tools: add script to check library exports against .ver files

This commit is contained in:
Dan Williams 2011-03-21 12:23:51 -05:00
parent a1fac30e6b
commit 235f96d2fd
2 changed files with 26 additions and 1 deletions

View file

@ -1 +1 @@
EXTRA_DIST = doc-generator.xsl
EXTRA_DIST = doc-generator.xsl check-exports.sh

25
tools/check-exports.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
LC_ALL=C
export LC_ALL
stat=0
so=$1
def=$2
# Have to prefix with a tab and suffix with a ';' to match .ver file format
get_syms='( objdump -t "$so" | grep "^[^ ]* [^l.*]*[.]"; objdump -t "$so" | grep "[.]hidden.*"; ) | sed "s/.* //" | sed "s/^/\t/" | sed "s/$/;/"'
echo $so: checking exported symbols against $def
{
echo "{"
echo "global:"
eval $get_syms | sort -u
echo "local:"
echo " *;"
echo "};"
} | diff -u "$def" - >&2 || stat=1
exit $stat