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

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.