GCC C ++ Name mangling Link

Looking around, I mainly see questions about replacing C ++ characters, and not about how to use them. Yes, one could invoke g++ using the -S option on some dummy code containing characters that would be garbled, and then examine the resulting assembly, but I could not find a good link or specification in the GCC name mangling. The closest I could find was http://www.int0x80.gr/papers/name_mangling.pdf , but it doesn't seem to cover things like how name pattern instances are created or why _Z3fooIN3BarEE3FooIXT_EEv will be translated to Foo<Bar> foo<Bar>() (although I can see how, but what the hell is IXT_EE ? Why is there no N after _Z in this? What does this mean?).

+5
source share
1 answer

Quote from gcc sources ( https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c ):

This file implements C ++ name manipulation in accordance with the IA64 C ++ ABI Specification.

And here are the rules from this specification: https://itanium-cxx-abi.imtqy.com/cxx-abi/abi.html#mangling

+9
source

Source: https://habr.com/ru/post/1262475/


All Articles