- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
working on TBB(probably no need to say we build it with Intel C++ Compiler), I need to analyze what symbols the library is expected to export. Currently I experience some lack of information with regard to mangling rules for constructors and destructors. Seems that in addition to in-charge and not-in-charge ctors/dtors generated by GCC, Intel compiler generates a couple more mangled as C9/D9. For example, the following list of symbols is generated for tbb::pipeline:
0000b2da T _ZN3tbb8pipelineC1Ev
0000b338 T _ZN3tbb8pipelineC2Ev
0000b300 T _ZN3tbb8pipelineC9Ev
0000b0b8 T _ZN3tbb8pipelineD0Ev
0000afde T _ZN3tbb8pipelineD1Ev
0000b2b2 T _ZN3tbb8pipelineD2Ev
0000b006 T _ZN3tbb8pipelineD9Ev
Could someone pleaseprovide me some information about what these additional ctor&dtor are for, in which cases they are used, and whatever else can be useful to know about it?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These are internal functions that the compiler generates calls to, you should be able to verifiy by looking at generated assembly file. icpc/icc is binary compatible with g++, the ctor/dtor calls will be the entry points allowing binary compatibility - ie you can link object code created by icpc with g++ if you pass the correct icc libs to the linker.
Regards,
JohnO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A() { printf("hi"); }
In this case both C1 and C2 functions will have the call to printf in gcc's implementation.
In our implementation we have one call to printf that exists in the "C9" function and C1 and C2 call the C9. You can think of the C9 function as you would any other routine created by the compiler. The ABI doesn't forbid us from naming it like this and it happens to be convenient.
There is an exception to this rule: vararg constructors. These must also be cloned so you won't see a C9 at all for these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the explanations.
Did I get it right that C9/D9 are strictly internal functions only called from the gcc-compliant ctors/dtors and never called directly from user code, and so I could safely leave those local to the library, provided that "regular" ctors and dtors are exported?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, that is correct.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page