svn commit: r281805 - head/tools/build

Bryan Drewery bdrewery at FreeBSD.org
Tue Apr 21 01:37:15 UTC 2015


Author: bdrewery
Date: Tue Apr 21 01:37:14 2015
New Revision: 281805
URL: https://svnweb.freebsd.org/changeset/base/281805

Log:
  Support demangling C++ symbols with -D flag.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/tools/build/check-links.sh

Modified: head/tools/build/check-links.sh
==============================================================================
--- head/tools/build/check-links.sh	Tue Apr 21 01:09:53 2015	(r281804)
+++ head/tools/build/check-links.sh	Tue Apr 21 01:37:14 2015	(r281805)
@@ -3,8 +3,10 @@
 
 ret=0
 CHECK_UNRESOLVED=1
-while getopts "U" flag; do
+DEMANGLE=
+while getopts "DU" flag; do
 	case "${flag}" in
+		D) DEMANGLE="-C" ;;
 		U) CHECK_UNRESOLVED=0 ;;
 	esac
 done
@@ -18,7 +20,7 @@ case $mime in
 esac
 
 # Gather all symbols from the target
-unresolved_symbols=$(nm -D -u --format=posix "$1" | awk '$2 == "U" {print $1}' | tr '\n' ' ')
+unresolved_symbols=$(nm ${DEMANGLE} -D -u --format=posix "$1" | awk '$2 == "U" {print $1}' | tr '\n' ' ')
 ldd_libs=$(ldd $1 | awk '{print $1 ":" $3}')
 
 libkey() {
@@ -50,7 +52,7 @@ for lib in $(readelf -d $1 | awk '$2 ~ /
 	done
 	list_libs="$list_libs $lib"
 	foundone=
-	lib_symbols="$(nm -D --defined-only --format=posix "${libpath}" | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ')"
+	lib_symbols="$(nm ${DEMANGLE} -D --defined-only --format=posix "${libpath}" | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ')"
 	if [ ${CHECK_UNRESOLVED} -eq 1 ]; then
 		# Save the global symbols for this lib
 		libkey "${lib}"


More information about the svn-src-all mailing list