I want to find some external symbols, used by one shared library (.so) in another. I easily can run
nm -D ./lib_the_one.so
and get list of used symbols by grepping, for example ' U ' (undefined symbols):
U The_external_symbol
Now I want to know, how many usages of some symbol is present (statically) in the whole library "lib_the_one.so". More exact,
- how many direct calls are there for some external function
- how many times the external variable is referenced
For example, I want to know that there are 10 functions in my "lib_the_one.so" with calls to calloc
inside them and 5 functions with calls to malloc
.
How can I do this using nm, objdump or any other util binutils (my OS is Linux)?