large G++ locale overhead in g++ 4.9.2

Gedare Bloom gedare at gwu.edu
Mon Jun 29 14:05:30 UTC 2015


On Mon, Jun 29, 2015 at 10:02 AM, Peter Dufault <dufault at hda.com> wrote:
>
>> On Jun 29, 2015, at 09:28 , Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
>>
>>> By only including the RTEMS shell commands I use I reduced the size to 1839664 (latest RTEMS) vs 1624684 (September RTEMS), about a 13% increase, but at least it fits in FLASH.
>>>
>>> The overhead appears to be mostly all the locale “stuff” in g++ 4.9.2 vs g++ 4.8.2.  I did some googling but don’t see how to reduce this, does anyone know of a way?  I really don’t need currency customization.
>>
>> What pulls in this locale stuff? Maybe
>>
>> CFLAGS += -ffunction-sections -fdata-sections
>>
>> LDFLAGS = -Wl,--gc-sections
>>
>> helps?
>
> I don’t know what pulls in the locale stuff or how to disable it.
>
> Your suggested flags makes a huge difference, it’s now 1424272 bytes in size, at 12% decrease from September and a 22% decrease from building the application with gcc 4.9.2 without the flags. I don’t see as much locale stuff in there.  I only recompiled the user application code and not RTEMS itself.
>
> Even better the application still runs.
>
> How can these options change what gets linked in?
>
These options let the compiler put every function in its own section
and use extra data sections, and the linker to remove any that are
unused. So it can provide a fine-tune way to remove unused code at
link time, but you need to be careful to mark any special sections
that must not be garbage-collected. I think Joel did this for the
SPARC. As you noticed, the options can make a big difference!


> Peter
> -----------------
> Peter Dufault
> HD Associates, Inc.      Software and System Engineering
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list