This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
Removing unused functions/dead code
- From: "Dr. Torsten Rupp" <rupp at aicas dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 08 Aug 2003 11:29:53 +0200
- Subject: Removing unused functions/dead code
Hi,
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