Question

In general, what I've observed using nm on Linux is that T symbol names (which I'm interested in) stay consistent across different computers even when I'm not using extern "C". Is my observation correct?

Note I'm using gcc on all computers.

Was it helpful?

Solution

It would be very unusual for the computer, the time of day, or the weather to affect name mangling.

What's more likely to cause deviations is differences in compiler version.

But many linux platforms define an ABI (application binary interface) for C++ which includes, among other things, the name mangling rules. On these platforms the same source code will compile to the same mangled names regardless of optimization levels, compiler versions, the hostname, the hard disk serial number, time of day, weather, whether your favorite sports team lost last week, or any factor not explicitly mentioned in the ABI.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top