LWN.net Logo

Striking gold in binutils

Striking gold in binutils

Posted Mar 28, 2008 16:26 UTC (Fri) by landley (guest, #6789)
In reply to: Striking gold in binutils by elanthis
Parent article: Striking gold in binutils

A friend of mine who still bothers with C++ explained to me once how C++ compilers used to use
a linker optimization where the name mangling would put the innermost identifiers first, and
the outermost identifiers last.  That way if you had these two symbols:

class1.class2.class3.class4.member1
class1.class2.class3.class4.member2

By comparing "member1" vs "member2" first, your string match would figure out inequality
faster.  If you go the other way, your string matches have to go through lots of common
namespace for every symbol before coming to the unique parts, and with BigLongMixedCaseNames
this can get fairly ridiculous.

Now, which way did the Intel Itanium C++ spec specify that name mangling had to occur?  The
long way that links slowly, of course.  And everybody else picked up the Itanium C++ spec
because nobody else bothered to write up a standard for this part of the language.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds