1 # check library exported symbols
9 -lib) lib
="$2" ; shift;;
11 esym
="${esym} com_right\$ free_error_table\$ initialize_error_table_r\$"
12 esym
="${esym} com_err error_message\$ error_table_name\$"
13 esym
="${esym} init_error_table\$ add_to_error_table\$"
14 esym
="${esym} reset_com_err_hook\$ set_com_err_hook\$ _et_list\$"
15 esym
="${esym} initialize_[A-Za-z0-9]*_error_table" ;;
17 esym
="${esym} print_version\$" ;;
19 esym
="${esym} copy_ free_ length_ decode_ encode_ length_ "
20 esym
="${esym} *.2int\$ int2 .*_units\$" ;;
21 -*) echo "unknown option $1" ; exit 1 ;;
27 for a
in "$@" $esym; do
28 symbols
="\$3 !~ /^${a}/ ${symbols:+&&} ${symbols}"
31 (nm .libs
/lib
${lib}.a || nm .libs
/lib
${lib}.so
*) |
32 awk "BEGIN { stat = 0 }
33 NF == 3 && \$2 ~ /[A-Z]/ && \$2 !~ /U/ && $symbols { printf \"%s should not be exported\\n\", \$3; ++stat } END { exit stat }"