vbox的更動 44473 路徑 trunk/src/bldprogs
- 時間撮記:
- 2013-1-30 下午04:37:38 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/bldprogs/checkUndefined.sh
r43257 r44473 15 15 # 16 16 # Compare undefined symbols in a shared or static object against a new-line 17 # separated list of grep patterns in a text file. 17 # separated list of grep patterns in a set of text files and complain if 18 # symbols are found which aren't in the files. 18 19 # 19 # Usage: /bin/sh <script name> <object> <allowed undefined symbols> [--static]20 # Usage: /bin/sh <script name> <object> [--static] <undefined symbol file...> 20 21 # 21 # Currently only works for native objects on Linux platforms22 # Currently only works for native objects on Linux (and Solaris?) platforms. 22 23 # 23 24 … … 27 28 } 28 29 29 hostos=$1 30 target=$2 31 symbols=$3 32 static=$4 33 34 if test $# -lt 3 || test $# -gt 4 || test ! -r "$target" || test ! -r "$symbols"; then 35 if test ! -r "$target"; then 36 echoerr "$0: '$target' not readable" 37 elif test ! -r "$symbols"; then 38 echoerr "$0: '$symbols' not readable" 39 else 40 echoerr "$0: Wrong number of arguments" 41 fi 42 args_ok="no" 30 hostos="${1}" 31 target="${2}" 32 shift 2 33 if test "${1}" = "--static"; then 34 static="${1}" 35 shift 43 36 fi 44 37 45 if test $# -eq 4 && test "$static" != "--static"; then 46 args_ok="no" 38 if test $# -lt 1; then 39 echoerr "${0}: Wrong number of arguments" 40 args_ok="no" 47 41 fi 42 if test ! -r "${target}"; then 43 echoerr "${0}: '${target}' not readable" 44 args_ok="no" 45 fi 46 for i in "${@}"; do 47 if test ! -r "${i}"; then 48 echoerr "${0}: '${i}' not readable" 49 args_ok="no" 50 fi 51 done 48 52 49 53 if test "$args_ok" = "no"; then 50 echoerr "Usage: $0 <object> <allowed undefined symbols> [--static]"54 echoerr "Usage: $0 <object> [--static] <undefined symbol file...>" 51 55 exit 1 52 56 fi … … 68 72 fi 69 73 70 if test ! -x "$ objdumpbin"; then71 echoerr "$ 0: '$objdumpbin' not found or not executable."74 if test ! -x "${objdumpbin}"; then 75 echoerr "${0}: '${objdumpbin}' not found or not executable." 72 76 exit 1 73 77 fi 74 78 75 undefined=`$objdumpbin $command $target | $grepbin '*UND*' | $grepbin -v -f $symbols | kmk_sed -e 's/^.*[[:blank:]]\(.*\)/\1/'` 79 undefined=`"${objdumpbin}" ${command} "${target}" | kmk_sed -n 's/.*\*UND\*.*\s\([:graph:]*\)/\1/p'` 80 for i in "${@}"; do 81 undefined=`echo "${undefined}" | "${grepbin}" -v -f "${i}"` 82 done 76 83 num_undef=`echo $undefined | wc -w` 77 84 78 85 if test $num_undef -ne 0; then 79 echoerr "$ 0: following symbols not defined in $symbols:"80 echoerr "$ undefined"86 echoerr "${0}: following symbols not defined in the files ${@}:" 87 echoerr "${undefined}" 81 88 exit 1 82 89 fi
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器