Suppose I'm "forensically" examining an object file that somebody else compiled. I don't have the source, and can't rely on debug symbols either. Still, I can use:
objdump -C -t my_object.o \
| sed -r '/\\*UND\\*/!d; s/000+\s+\*UND\*\s+000+ //;' \
| sort
to get the external symbols it uses.
But what if what I'm after is the count of uses of each of these symbols? Is there a way to get that without, say, arduously parsing the disassembled code?
Notes:
- A GNU system (e.g. Linux)
- Assume basic tools used in C++ software development are installed.
For functions you could look at the number of relocations, for example:
Here we have two relocations, each corresponding to one function call.