On 2007-06-09, Fco Javier Rodríguez García <[email protected]> wrote:
> One optimization CodeWarrior does is like this: If you don't
> use one function in your source code, then CW doesn't compile
> that function and throw it away, which means, CW only yields
> code for those functions that actually you use. I saw GCC
> didn't, even with -O3 or -Os, is there someway or option in
> GCC to achieve what CW does?
Pass -ffunction-sections to the compiler and --gc-sections to
the linker.
If you want data objects you can add -fdata-sections to the
compiler flags, but you'll need a version of gcc containing
some patches I submitted a while back...
BTW, "gc" stands for "garbage collection", in case you missed
the thread currently running in the msp430 group where somebody
is claiming that "garbage collection" is not the correct phrase
for this feature, that it's wrong for compilers to discard
unused objects, because doing so will break all sorts of
programs.
--
Grant Edwards grante Yow! I like the way ONLY
at their mouths move... They
visi.com look like DYING OYSTERS