Add instructions for symbol lookup

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13647 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming committed 2006-03-16 15:38:46 +00:00
1 parent 5e9b699a7a
commit 7e80c52cd2
1 file changed
+39
+39
View File
@@ -161,3 +161,42 @@ This file needs to be cleaned up in two ways:
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