This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Removing unused functions/dead code


"Dr. Torsten Rupp" <rupp@aicas.com> writes:

> 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).

See -ffunction-sections at:
http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Optimize-Options.html#Optimize%20Options


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]