Have you tried using "nm"? It gives you a list of defined and undefined characters in object / library files (see the documentation here .
It mentions the approach mentioned in this post from Bernd Strieder, which I am considering with -
1. Use nm to generate a list of symbols in all object/library files involved.
2. This file is parsed and basically the (U)ndefined and (T)ext symbols
and the symbols of main functions are filtered out and mapped to their
object files. I found that U and T symbols suffice, which reduces the
overall problem considerably compared to the linker, which has to
consider all symbols.
3. The transitive hull of the dependency relation according to U and T
symbols between object files is being calculated.
4. A list of object files needed to resolve all dependencies can be
printed for any object file.
5. For any main object file, a make target to link it is arranged.
source
share