to reduce footprint

Ian Lance Taylor iant@google.com
Tue Dec 19 04:01:00 GMT 2006


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



More information about the Binutils mailing list