O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name Mangling

C++ uses name mangling for doing typesafe linking. The compiler encodes type information in a function’s name, which can lead to unreadable error messages or indecipherable output from Unix tools like nm You might be poking around an object file and see something like this:

$​ ​n​m​ ​s​l​i​d​e​m​a​s​t​e​r​.​o​
.​.​.​
0​0​0​0​0​0​3​0​ ​s​ ​E​H​_​f​r​a​m​e​1​
 ​ ​ ​ ​ ​ ​ ​ ​ ​U​ ​_​_​Z​N​1​2​B​i​g​N​e​r​d​R​a​n​c​h​7​B​i​g​S​h​o​w​5​S​l​i​d​e​1​3​D​i​s​p​l​a​y​I​n​V​i​e​w​E​P​7​B​i​g​V​i​e​w​
 ​ ​ ​ ​ ​ ​ ​ ​ ​U​ ​_​_​_​g​x​x​_​p​e​r​s​o​n​a​l​i​t​y​_​v​0​
.​.​.​

That "__ZN12BigNerdRanch..." symbol looks interesting. Here it is made human readable:

$​ ​c​+​+​f​i​l​t​ ​_​_​Z​N​1​2​B​i​g​N​e​r​d​R​a​n​c​h​7​B​i​g​S​h​o​w​5​S​l​i​d​e​1​3​D​i​s​p​l​a​y​I​n​V​i​e​w​E​P​7​B​i​g​V​i​e​w​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required