COMDAT group questions

scott douglass sdouglass at arm.com
Fri Sep 6 11:59:18 UTC 2002


Hello,

In section 5.2.2 Static Data the C++ ABI for Itanium (Draft) says:

>Inline functions, whether or not declared as such, and whether they are inline or out-of-line copies, may reference static data or character string literals, that must be kept in common among all copies by using the local symbol mangling defined above. These objects are named according to the rules for local names in the Scope Encoding section above, and the definition of each is emitted in a COMDAT group, identified by the symbol name described in the Scope Encoding section above. Each COMDAT group must be emitted in any object with references to the symbol for the object it contains, whether inline or out-of-line. 

Does "the definition of each is emitted in a COMDAT group" mean "the definition of each is emitted in its own COMDAT group"?  I think the rest of the paragraph implies this but I want to check that I'm not confused.

A related question:  What are all the cases in the ABI where COMDAT groups have more than one section in them?  I think the following is true:
  [] a vtable, its construction vtables (if any) and VTT (if any) are emitted in the same COMDAT group
  [] a static guard variable may be in the same COMDAT group as the static variable it is guarding or it can be alone
  [] all other COMDAT groups must contain just one section

Have I got that right?

Another:  What is the purpose of having the vtable, construction vtables and VTT in a single COMDAT group?  Is there some way in which problems could arise if the vtable, construction vtables and VTT were in separate COMDAT groups?  It seems like the vtable, construction vtables and VTT must be the identical in all translation units and from all compilers.  (Except the construction vtables names but they are only referred to from the VTT.)

Thanks.




More information about the cxx-abi-dev mailing list