On 2007-06-30, N. Coesel <[email protected]> wrote:

>>I'm trying to get mspgcc to optimize my binary's size by
>> removing unused functions during the linking process. gcc
>> supports this feature starting from a version >=4.0

IIRC gcc has supported that since before 2.0.

>> adding this
>>
>>CLFAGS = -ffunction-sections -fdata-sections
>>LDFLAGS = --gc-sections

> You could consider placing each function into a seperate file.

That's a bad idea as it requires data shared by the functions
to be placed in the global namespace

> But if your software contains unused functions, why bother to
> keep the unused functions?

Becase in some versions of the product they are used.

> You can delete them or compile them conditionally with #ifdef.

Just use -ffunction-sections.  That's what it's intended for.

-- 
Grant Edwards                   grante             Yow!  Hmmm... an arrogant
                                  at               bouquet with a subtle
                               visi.com            suggestion of POLYVINYL
                                                   CHLORIDE...


Reply via email to