I have a question concerning removing unused functions/dead code. I could not find any hint to this in the gcc documentation.
I created with gcc and ar a library containing object files with many functions. When I link the library either with gcc or ld to a compiled application all functions of an object file in the library a linked to the application, even only a single independant function from an object file is needed. Is it possible with gcc/ld to remove unused function when the application is linked? For me is looks like it should be possible in the case when no reference to an unused function exists (which is the definition of unsed).
If somebody knows if this is possible or can tell my why it is not possible I'm looking forward to some email.
Thank you very much.
Torsten Rupp