This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: How about add two new configuration options(-ffunction-sections -fdata-sections)
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: "Bin Cheng" <bin dot cheng at arm dot com>, <newlib at sources dot redhat dot com>
- Date: Mon, 20 Feb 2012 13:16:11 -0500
- Subject: RE: How about add two new configuration options(-ffunction-sections -fdata-sections)
- References: <001b01ccef84$77815d30$66841790$@cheng@arm.com>
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."
By the way, have you estimated the potential savings?
Craig
-----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?
So what's your opinion on this?
Thanks.