[RFC] C++1x breaking the ABI in one more place :(

Ian Lance Taylor iant@google.com
Thu May 20 03:29:00 GMT 2010


Mark Mitchell <mark@codesourcery.com> writes:

> Ian Lance Taylor wrote:
>
>> The vtables in libstdc++ have symbol versions.  Therefore it is
>> possible in principle to keep the old vtable at the old symbol version
>> (GLIBCXX_3.4) and provide the new vtable at the new version.
>
> That's an interesting idea.  We don't have an easy way of getting the
> compiler to provide the old version of the vtable, but we could make
> one, or, at least in theory, do the vtable by hand.  But, that still
> doesn't help if you pass an old version of the derived class to
> something expecting the new version, so that doesn't seem like a very
> complete solution.

Hmmm, that is true.  Perhaps we need a way to include a version number
in the symbol mangling.  That would actually be simpler: using an
attribute in a class declaration could change the mangling of all
symbols associated with that class.  Of course, we would then give up
compatibility between gcc and non-gcc compilers, but I'm skeptical
that non-gcc compilers are reading the same libstdc++ header files.

It appears that the C++ ABI committee unfortunately did not consider
how to handle ABI changes over time.

Ian



More information about the Libstdc++ mailing list