[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC -- reducing compiled code size
From: |
Ignoramus3627 |
Subject: |
Re: GCC -- reducing compiled code size |
Date: |
Mon, 23 Jul 2007 13:41:52 -0500 |
User-agent: |
slrn/0.9.8.1pl1 (Linux) |
On Mon, 23 Jul 2007 11:05:54 -0700, Paul Pluzhnikov
<ppluzhnikov-nsp@charter.net> wrote:
> Ignoramus3627 <ignoramus3627@NOSPAM.3627.invalid> writes:
>
>> We have a library that has 179385 lines of code.
>> With GCC, no debug information requested (no -g option) it creates a
>> 31 meg long .a library file.
>>
>> I think that it is excessive. Any idea what I can do to reduce the
>> size?
>
> You can try to understand where that size comes from -- extract a
> couple of .o files from the library, and examine what they are
> comprized of (exact commands for this are system specific, and you
> provided no clues what your platform might be).
Linux, GCC 4.1.
> It is likely that you have many template instances repeated into
> every .o. When you link final executable, only one copy is linked
> in on most platforms, so the size of lib*.a is usually of little
> concern (disk space is cheap).
>
interesting. Thanks
i