[Gnucash-changes] r13647 - gnucash/trunk - Add instructions for symbol lookup

Christian Stimming cstim at cvs.gnucash.org
Thu Mar 16 10:38:47 EST 2006


Author: cstim
Date: 2006-03-16 10:38:46 -0500 (Thu, 16 Mar 2006)
New Revision: 13647
Trac: http://svn.gnucash.org/trac/changeset/13647

Modified:
   gnucash/trunk/HACKING
Log:
Add instructions for symbol lookup

Modified: gnucash/trunk/HACKING
===================================================================
--- gnucash/trunk/HACKING	2006-03-16 15:25:12 UTC (rev 13646)
+++ gnucash/trunk/HACKING	2006-03-16 15:38:46 UTC (rev 13647)
@@ -161,3 +161,42 @@
 
 2/ There are a bunch of suppressions which need to not be supressions, but
    instead just not be generated by valgrind.
+
+
+Look up exported and imported symbols
+-------------------------------------
+These commands may be useful to find out the library that actually
+exported a particular symbol, and to check which import symbol one
+particular library depends upon and where they are imported
+from. Run these from the top-level of the build tree.
+
+# Create a table of all exported symbols and where they come from
+nm -A `find . -name '*.so'` | grep ' T ' | \
+  sed 's/^\([^:]*\).* \([^ ]*\)$/\1: \2/' > exportedsymbols
+
+# For a particular library, check symbol import requirements, 
+# listing all symbols (needs the file from above)
+A=src/gnc-module/.libs/libgw-gnc-module.so && echo "$A requirements:" \
+  && nm $A | grep ' U ' | sed 's/^.* \([^ ]*\)$/\1/' | \
+  grep -wFf- exportedsymbols
+
+# For a particular library, check import requirements, 
+# summarized by library
+A=src/gnc-module/.libs/libgw-gnc-module.so && echo "$A requirements:" \
+  && nm $A | grep ' U ' | sed 's/^.* \([^ ]*\)$/\1/' | \
+  grep -wFf- exportedsymbols | cut -d: -f1 | sort | uniq
+
+# For a particular library, check import requirements, 
+# summarized by library, formatted for Makefile.am
+A=src/gnc-module/.libs/libgw-gnc-module.so && echo "$A requirements:" \
+  && nm $A | grep ' U ' | sed 's/^.* \([^ ]*\)$/\1/' | \
+  grep -wFf- exportedsymbols | cut -d: -f1 | sort | uniq | \
+  sed 's!.libs/!!' | sed 's/.so$/.la \\/' | sed 's!^.!  \${top_builddir}!'
+
+# List all import requirements summarized by library for a full
+# recursive directory tree
+for A in `find src/business/business-core -name '*.so'`; do \
+  echo -e "\n##$A requirements:" && nm $A | grep ' U ' | \
+  sed 's/^.* \([^ ]*\)$/\1/' | grep -wFf- exportedsymbols | \
+  cut -d: -f1 | sort | uniq; done
+



More information about the gnucash-changes mailing list