#!/bin/sh -u

files=${*-*.o}
status=0

for f in $files; do
    bad=`
	nm $f |
	awk '$3 !~ /^_*perperl/ && $3 !~ /^_*main$/ && $3 !~ /^_*xs_init$/ && ($2 == "T" || $2 == "C" || $2 == "D" || $2 == "B") {
	    print $3;
	}'
    `
    if test "$bad" != ""; then
	echo Error in ${f}: exporting symbols $bad
	status=1
    fi
done
exit $status
