This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: How about add two new configuration options(-ffunction-sections -fdata-sections)



> -----Original Message-----
> From: Schwarz, Konrad [mailto:konrad.schwarz@siemens.com]
> Sent: Monday, February 27, 2012 7:21 PM
> To: Howland Craig D (Craig); Bin Cheng; newlib@sources.redhat.com
> Subject: RE: How about add two new configuration
options(-ffunction-sections -
> fdata-sections)
> 
> > -----Original Message-----
> > From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
> > On Behalf Of Howland Craig D (Craig)
> 
> > One opinion is that if it is done, it must not be the default.  Quoting
> > from the GCC manual regarding -ffunction-sections and -fdata-sections:
> >
> > "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."
> >
> 
> > -----Original Message-----
> > From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
> > On Behalf Of Bin Cheng
> > Sent: Sunday, February 19, 2012 11:02 PM
> > To: newlib@sources.redhat.com
> > Subject: How about add two new configuration options(-ffunction-
> > sections
> > -fdata-sections)
> >
> > Hi,
> > Now in newlib there are cases where different functions are implemented
> > in
> > one c source file.
> > So how about adding two configuration options like
> > "--enable-function-sections"/"-fdata-sections"
> > which builds newlib with "-ffunction-sections" and "-fdata-sections"
> > options.
> > With this, we can cut binary size with link's option "--gc-sections".
> >
> > Now in gcc, libgcc/libstdc++ are built with this options defaultly for
> > cross
> > compiling.
> > Should we enable this in Newlib?
> 
> Why not split files containing multiple functions with non-static linkage
into
> separate
> files, one per function?

I have no preference over the two methods, but this way may involve
restructuring
lots of files.
Either way, more comments are needed.

Thanks.




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