s4-devel: a very useful script when dealing with library/linking issues
authorAndrew Tridgell <tridge@samba.org>
Fri, 7 May 2010 11:47:37 +0000 (13:47 +0200)
committerAndrew Tridgell <tridge@samba.org>
Fri, 7 May 2010 13:14:49 +0000 (15:14 +0200)
I use this all the time, so I thought I'd put it in the tree for
others

source4/scripting/devel/nmfind [new file with mode: 0755]

diff --git a/source4/scripting/devel/nmfind b/source4/scripting/devel/nmfind
new file mode 100755 (executable)
index 0000000..54935f2
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# find object files containing a symbol
+# for example:
+#   nmfind foo_function $(find bin/default -name '*.o')
+
+TARGET=$1
+shift
+for f in $*; do
+if nm $f 2>&1 | grep $TARGET > /dev/null; then
+  echo [$f]
+  nm $f | grep $TARGET
+  echo
+fi
+done