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: "Bin Cheng" <bin dot cheng at arm dot com>
- To: "'Howland Craig D \(Craig\)'" <howland at lgsinnovations dot com>, <newlib at sources dot redhat dot com>
- Date: Tue, 21 Feb 2012 16:44:27 +0800
- Subject: RE: How about add two new configuration options(-ffunction-sections -fdata-sections)
- References: <001b01ccef84$77815d30$66841790$@cheng@arm.com> <3862C5643B15B6468269546753EB2A92065BF407@BLTSXVS01.govsolutions.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."
Yes, it should be disabled by default.
>
> By the way, have you estimated the potential savings?
Here is size information for an typical mcu program:
$ arm-none-eabi-size app.axf.gc_section
text data bss dec hex filename
35032 2492 2260 39784 9b68 app.axf.gc_section
$ arm-none-eabi-size app.axf.no-gc_section
text data bss dec hex filename
41144 2560 2300 46004 b3b4 app.axf.no-gc_section
Thanks very much.