to reduce footprint

Ian Lance Taylor iant@google.com
Wed Dec 20 17:18:00 GMT 2006


Lin George <george4academic@yahoo.com> writes:

> 1. -s is used for strip symbols, is my finding correct? If yes, I have a concern whether strip (remove) symbols will reduce some functions of my binary? Since I think footprint and size are a balanced pair. If I make footprint smaller, I will lose some functions of the binary?

Note that I did not mention -s.  I mentioned -Os, which is a compiler
option.

-s does strip symbols.  It does not affect the executable.  It affects
your ability to debug the executable.

> 2. -n is used for remove page alignment to reduce un-necessary page level alignment (for example, un-necessary padding or something). Is my understanding correct?

-n removes some page alignment.  You still haven't mentioned which
target you are interested in.  For a GNU/Linux target, the page
alignment will let your executable startup faster.  For an embedded
target, it doesn't matter.

Ian

> ----- Original Message ----
> From: Ian Lance Taylor <iant@google.com>
> To: Lin George <george4academic@yahoo.com>
> Cc: binutils@sourceware.org
> Sent: Tuesday, December 19, 2006 11:58:45 AM
> Subject: Re: to reduce footprint
> 
> 
> Lin George <george4academic@yahoo.com> writes:
> 
> > I am wondering how to reduce the footprint of a binary build (C/C++) program generated by gcc.
> > 
> > 1. Any ideas of reduce the footprint of a debug version build?
> > 2. Any ideas of reduce the footprint of a release version build?
> > 
> > I think some linker or compiler options may help, what are they? Any other ideas to reduce footprint?
> 
> The obvious place to start is the compiler option -Os, which tells gcc
> to optimize for size.
> 
> You didn't mention which target you were interested in.  For some
> embedded targets, the linker options -n or -N may help.
> 
> Ian
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 



More information about the Binutils mailing list