On 2011-08-03, Peter Bigot <big...@acm.org> wrote:

> The library archives are built so that unreferenced functions are not
> linked in.

There are other files in most projects besides the library archives. ;)

> Furthermore, I believe gc-sections operates on whole sections, not
> functions, so unless you have code built with -ffunction-sections it
> would make no difference.

Yes, in order for gc-sections to be useful you need to use
-ffunction-sections and -fdata-sections -- and that's generally how
people use it.

> Until the binutils update from half an hour ago, I have no reason to
> believe mspgcc supported -ffunction-sections correctly.

The old 3.x version did.  I used it for years.

> (The linker changes will not be back-ported to the 4.5.3 LTS
> release.) The same should hold for -fdata-sections.

Are you saying that -fdata-sections is broken in recent versions of
mspgcc?

> If you see a reduction in code size when you use --gc-sections, and
> what it removes really wasn't necessary, figure out why it got put in
> there in the first place and fix it there.

That's pretty narrow-minded.

When reusing code, it's _very_ useful to be able to put a set of
related functions in a single file so that you can avoid name-space
issues and only expose certain selected names in the global namespace.
If all of the functions aren't needed for a given project, you
-ffunction-sections and -gc-sections can be used to discard the ones
that aren't needed.  This has been a common way of doing things for a
long time.  I've been using it for at least a dozen years and I
certainly didn't invent it.  I don't see how you can decided all of a
sudden that it's not valid.

Putting each function in a separate file produces a big mess both --
both in relation to namespace pollution and managing source files.

-- 
Grant Edwards               grant.b.edwards        Yow! ... the HIGHWAY is
                                  at               made out of LIME JELLO and
                              gmail.com            my HONDA is a barbequeued
                                                   OYSTER!  Yum!


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to