This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: -ffunction-sections, -ffdata-sections


In a message dated 1/27/2003 9:33:28 AM Eastern Standard Time, phil@jaj.com writes:

> 
> 
> On Sun, Jan 26, 2003 at 05:12:41PM -0500, AWLaFramboise@aol.com wrote:
> > I notice libstdc++-v3 builds with -ffunction-sections and 
> > -ffdata-sections if they are availible.  Why is this?
> 
> Because they're improvements.
> 

Could you elaborate?  It seems to me that --function-sections 
and -fdata-sections are not general-purpose optimization 
options.  The GCC manual has this to say about them:

Only use these options when there are significant benefits 
from doing so. When you specify these options, the assembler 
and linker will create larger object and executable files and 
will also be slower. You will not be able to use gprof on all 
systems if you specify this option and you may have problems 
with debugging if you specify both this option and -g. 

The benefits of this option are that we can improve locality 
of reference(1) and remove unused objects(2).  However, most 
systems I am familiar with do not seem to have support for #1, 
and #2 is not possible in the general case because section gc 
on a few targets, and generally only when statically linking.

However, in addition to whatever the GCC manual claims above, 
I personally have noticed that -ffunction-* substancially increase binary size.

So, I was wondering if there is any particular reason 
libstdc++-v3 uses these options, because, to me, they do not 
seem like reasonable default options in the general case.


Aaron W. LaFramboise - AaronWL


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