[RFC] libgcov.c re-factoring and offline profile-tool

Jakub Jelinek jakub@redhat.com
Tue Nov 5 09:34:00 GMT 2013


On Tue, Nov 05, 2013 at 10:18:50AM +0100, Jan Hubicka wrote:
> > I wonder if it makes sense to get rid of the conditional compile such as
> > 
> > #ifdef L_gcov_xxxxx
> > ..
> > 
> > #endif
> > 
> > This has the advantage of producing slightly smaller instrumented
> > binary, but this benefit can also be achieved via -ffunction-sections
> > and let linker to garbage collect unused functions.
> > 
> > (probably as a follow up if it makes sense).
> 
> I believe we use this funny scheme primarily for targets that have no function
> section support (and also the hand made splitting can be more sane).
> For a low-level library like libgcov is that is supposed to have small footprint,
> I guess the current scheme is resonable thing to do....

I think the #ifdef L* stuff is there mainly so that we have small
granularity in the *.a libraries (one function per object file), so that one
links only what is really required (at least, that is why libgcc.a does
that).  Of course, if there are many interdependencies between the functions
and you always essentially link in everything, the usefulness of that is
lower.

	Jakub



More information about the Gcc-patches mailing list