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]
Other format: [Raw text]

Re: Duplicate data objects in shared libraries

--On Monday, May 20, 2002 08:06:56 PM +0100 Jason Merrill 
<> wrote:

>>>>>> "Mark" == Mark Mitchell <> writes:
>>> A good point, though we could handle this by decorating the RTTI name
>>> for S with the unnamed namespace qualifier.  I suppose this sort of
>>> thing is what leads people to want to remove internal linkage entirely.
>> We're clearly in the land of corner cases, but changing the RTTI name for
>> S would be an incompatible ABI change.
> I don't think it would be incompatible; S is file-local, so its
> compatibility with things from other files is either uninteresting or
> actually undesirable.

Hmm.  I think that the ABI specifies the name -- even for the local class
in the method with static linkage -- and therefore I can write
ABI-conforming code that does:

  if (strcmp (typeid (S).name(), "<mangled name here>") != 0)
    abort ();

It would be reasonable to have an ABI that says basically nothing about
objects with internal linkage, but I don't think ours does.

> I think that being able to write plugins in C++ is important, and a

I guess I just don't think that using RTLD_LOCAL is the only reasonable
way to do it.

But, if there's a good solution here, we should definitely do it.

Mark Mitchell         
CodeSourcery, LLC     

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