This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: to reduce footprint


Thanks Ian. After reading the manual for -Os, it seems that using -Os can both achieve the better performance and reduce the footprint. Is that correct?
If yes, it is amazing that both size can be reduced the speed is faster. Because I think speed and size are balanced parameters -- if you increase speed, the footprint will be worse (bigger). Any comments?

BTW: Quote from manual > -Os is ok to optimize for speed.


regards,
George

----- Original Message ----
From: Ian Lance Taylor <iant@google.com>
To: Lin George <george4academic@yahoo.com>
Cc: binutils@sourceware.org
Sent: Thursday, December 21, 2006 1:16:43 AM
Subject: Re: to reduce footprint


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

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]