This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Removing space waste for g++ static inlined objects

>>>>> "Ronald" == Ronald F Guilmette <> writes:

> Included below is a revised and simpler one that seems to work quite
> well.  It still doesn't live up to all of my best hopes with regard
> to link-time ``global'' (inter-compilation-unit) name conflicts/pollution,
> but I'm not sure that all of the problems in this regard can be solved
> without totally reinventing what we know as ``linking'' anyway.  In
> other words, it looks to me like the definition of the language (C++)
> causes some basically insoluable problems, and that we just have to
> muddle along as best as we can... at least until some brave soul steps
> forward who wants to totally re-implement the linker from scratch.

What problems are you referring to?  As you suspected and I confirmed, the
ODR guarantees that a class always refers to the same class throughout the

> Anyway, for now, this patch makes the wasted space for static-duration
> extern-inline-function-nested objects go away.  It has been tested on
> a big application and seems to work.

Thanks, but it'll need some more work to go into CVS; first, of course,
you'll need to update it to the current source tree (which has no function
called build_static_name).  Also, rather than just call comdat_linkage, it
should use the code currently wrapped in 'if (!flag_weak)', so that
primitive object formats work somewhat.  Finally, we need to support
calculating the discriminator properly for non-types.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]