2 # check library exported symbols
8 esym
="__i686.get_pc_thunk fc_softc"
11 # AIX has different default output format
13 if [ "`uname`" = AIX
]; then
17 while test $# != 0 ;do
19 -lib) lib
="$2" ; shift;;
21 esym
="${esym} com_right\$ free_error_table\$ initialize_error_table_r\$"
22 esym
="${esym} com_err error_message\$ error_table_name\$"
23 esym
="${esym} init_error_table\$ add_to_error_table\$"
24 esym
="${esym} reset_com_err_hook\$ set_com_err_hook\$ _et_list\$"
25 esym
="${esym} et_[A-Za-z0-9]*_error_table"
26 esym
="${esym} initialize_[A-Za-z0-9]*_error_table et_*_error_table" ;;
28 esym
="${esym} print_version\$" ;;
30 esym
="${esym} copy_ free_ length_ decode_ encode_ length_ "
31 esym
="${esym} *.2int\$ int2 asn1_[A-Za-z0-9]*_units\$" ;;
32 -*) echo "unknown option $1" ; exit 1 ;;
38 for a
in "$@" $esym; do
39 symbols
="\$3 !~ /^[_\.]?${a}/ ${symbols:+&&} ${symbols}"
42 # F filename, N debugsymbols, W weak symbols, U undefined
44 (nm
$nmargs .libs
/lib
${lib}.a || nm
$nmargs .libs
/lib
${lib}.so
*) |
45 awk "BEGIN { stat = 0 }
46 NF == 3 && \$2 ~ /[A-EG-MO-TVX-Z]/ && $symbols { printf \"%s should not be exported (type %s)\\n\", \$3, \$2; ++stat } END { exit stat }"