#! /bin/sh # Identify non-compat symbols exported from shared libraries that are # not tested by any glibc testcase. # $1 is the awk program to use. $2 is the path to abilist-mod.awk. # $3 is the objdump program to use. $4 is the nm program to use. Run # this from a glibc build tree where the testsuite has been run. set -e export LC_ALL=C AWK=$1 abilist_mod=$2 OBJDUMP=$3 NM=$4 libraries="ld libBrokenLocale libanl libc libcrypt libdl libm libnsl \ libpthread libresolv librt libthread_db libutil" ld_path=elf/ld.so libBrokenLocale_path=locale/libBrokenLocale.so libanl_path=resolv/libanl.so libc_path=libc.so libcrypt_path=crypt/libcrypt.so libdl_path=dlfcn/libdl.so libm_path=math/libm.so libnsl_path=nis/libnsl.so libpthread_path=nptl/libpthread.so libresolv_path=resolv/libresolv.so librt_path=rt/librt.so libthread_db_path=nptl_db/libthread_db.so libutil_path=login/libutil.so for lib in $libraries; do eval path=\$${lib}_path $OBJDUMP --dynamic-syms $path > ldynsym-$lib $AWK -f $abilist_mod ldynsym-$lib > lsyms-unsorted-$lib sort < lsyms-unsorted-$lib > lsyms-$lib rm -f ldynsym-$lib lsyms-unsorted-$lib done : > tested-syms-unsorted for testout in $(find . -name '*.out'); do test=${testout%.out} if [ -f $test ] && file $test | grep -q 'ELF.*dynamic'; then $NM -D $test | sed 's/.* //' >> tested-syms-unsorted fi done sort -u < tested-syms-unsorted > tested-syms rm -f tested-syms-unsorted for lib in $libraries; do echo "Untested symbols in $lib:" echo while read sym; do if ! grep -q "^$sym\$" tested-syms; then echo $sym fi done < lsyms-$lib echo done