Most compilers / linkers optimize unused characters. If you are working on a * nix system, you can try using the "nm" command for all object files, filtering and sorting it to create a list of all exported functions defined by these object files.
nm *.o | grep "^[0-9a-f]* T " | sed 's/^[0-9a-f]* T //' | sort -u > symbols_in.txt
I believe that you can do the same in the final binaries.
If you then separate the two result sets, you should get a list of all unused exported functions.
Remember that some functions may be used by code that is excluded due to conditional compilation. For example. #ifdef, to say that on platform A use such built-in functions, and on another platform use your own version of the function, because there is no built-in or standard library equivalent or it does not work properly.
AlastairG Dec 15 '10 at 12:38 2010-12-15 12:38
source share