Re: Name mangling

Alain Miniussi <alainm@cup.hp.com>
6 Jul 2001 16:32:45 -0400

          From comp.compilers

Related articles
Name mangling youngwk@yahoo.com (Young Wei Kuan) (2001-07-01)
Re: Name mangling thant@acm.org (Thant Tessman) (2001-07-02)
Re: Name mangling fjh@cs.mu.OZ.AU (2001-07-03)
Re: Name mangling toon@moene.indiv.nluug.nl (Toon Moene) (2001-07-06)
Re: Name mangling alainm@cup.hp.com (Alain Miniussi) (2001-07-06)
Re: Name mangling dosreis@cmla.ens-cachan.fr (Gabriel Dos Reis) (2001-07-17)
Re: Name mangling alainm@cup.hp.com (Alain Miniussi) (2001-07-18)
Re: Name mangling dosreis@cmla.ens-cachan.fr (Gabriel Dos Reis) (2001-07-23)
| List of all articles for this month |

From: Alain Miniussi <alainm@cup.hp.com>
Newsgroups: comp.compilers
Date: 6 Jul 2001 16:32:45 -0400
Organization: HP
References: 01-07-008 01-07-027 01-07-038
Keywords: C++, GCC
Posted-Date: 06 Jul 2001 16:32:45 EDT

Fergus Henderson wrote:
>
> Young Wei Kuan wrote:
>
> > I understand g++ 3.0 has changed its name-mangling scheme.
> > [...] Why is it that object code compiled by g++ 2.95 is incompatible with
> > that of gcc3.0?
>
> Object code compiled by g++ 2.95 is incompatible with that of g++ 3.0
> because of changes in the way things are implemented. For example,
> g++ 3.0 uses a different implementation of exception handling than g++
> 2.95 did. This affected compatibility with code compiled with g++
> 2.95, i.e. the ABI (Application Binary Interface) changed.


Other changes probably includes object layout and vtables layout.


> When compilers change the way things are implemented in ways that
> change the ABI, they often change the name-mangling scheme at the same
> time, to prevent users from accidentally linking together components
> that are not compatible and which might fail mysteriously at run-time
> if they were linked together. Using a different name mangling scheme
> can ensure that such problems result in link errors rather than
> run-time crashes.
>
> However, I don't know if that is what motivated changes in name
> mangling between g++ 2.95 and g++ 3.0, or whether they were needed for
> other reasons (e.g. standard-conformant handling of certain template
> constructs).


That change was motivated by the fact that gcc plans to comply to
a new common C++ abi on IA64. Name mangling is part of that abi
(see http://www.codesourcery.com/cxx-abi/) and I guess that there
is no point in using a different mangling depending on the abi.


Alain


> Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
> The University of Melbourne | of excellence is a lethal habit"
> WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.