Re: Name mangling

fjh@cs.mu.OZ.AU (Fergus Henderson)
3 Jul 2001 23:23:38 -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: fjh@cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.compilers
Date: 3 Jul 2001 23:23:38 -0400
Organization: Computer Science, University of Melbourne
References: 01-07-008 01-07-027
Keywords: GCC, C++, debug
Posted-Date: 03 Jul 2001 23:23:37 EDT

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.


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).
--
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.