unused functions removal of gcc toolchain?

David Korn dkorn@pixelpower.com
Wed Oct 10 04:17:00 GMT 2001


>-----Original Message-----
>From: SungKunCho [ mailto:s-kcho@hanmail.net ]
>Sent: 10 October 2001 00:43


>Hi,
>
>Does gcc toochain have "unreferenced functions(not unused virtual
>functions) removal" feature?(any options etc)
>It seems like if gcc toolchain provides this feature, 
>oversized C++ code
>could be reduced.
>In my case, due to the link of unnecessary functions, C++ 
>executable image
>is oversized. It looks like this problem is partially resolved 
>if class is redefined and big object codes are divided to smaller ones.

  This is usually done by making a library archive file (.a) which contains
each function in a separate .o module.  The linker only pulls the .o files
that contain symbols that are referenced into the final executable.

  You might be able to approximate a solution to this problem by combining
the -ffunction-sections argument of gcc with the --gc-sections option for
ld, but this apparently doesn't work on all targets.  Check the docs for
gcc and ld to see how these switches work.


     DaveK
-- 
Burn your ID card!  http://www.optional-identity.org.uk/
Help support the campaign, copy this into your .sig!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list