Binary is twice bigger

Sergei Organov osv at topconrd.ru
Tue Dec 23 12:54:23 UTC 2003


Leon Pollak <leonp at plris.com> writes:

> On Tuesday 23 December 2003 14:25, you wrote:
> > > * The Linker does a real good job of dead-stripping code
> > GCC can do it as well:
> > during compilation: -ffunction-sections
> > during link: -Wl,--gc-sections
> This is what "info gcc" says about -ffunction-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.
> --------
> The increasing of object file is obvious, but why the executable may
> increase?

Take it easy, it won't increase.

> And why the executable will be slower!?

You misinterpreted the statement, it's assembling and linking that will be
slower, not executable.

> 
> It seems to be problematic, no?

No, it isn't. At least I use it for a few years now without any problems.
Though you will need to tweak your linker scripts a little bit changing
statements like '*(.text)' to '*(.text*)', as, e.g., function with the name
'foo' is put in the object file into section called '.text.foo', not into
'.text'.

-- 
Sergei.




More information about the users mailing list