| Linux Standard Base C++ Specification 3.0Preview1 | ||
|---|---|---|
| <<< Previous | Next >>> | |
Support for the C++ language shall be as specified in Itanium C++ ABI.
Note: This document, although containing a few architecture specific matters, is written as a generic specification, to be usable by C++ implementations on a variety of architectures.
An object file generated by the compilation process for a C++ program shall contain several closely related internal objects, or Class Components, to represent each C++ Class. Such objects are not a visible part of the source code. Table 7-1 describes these Class Components at a high level.
Table 7-1. Class Components
| Object | Contains |
|---|---|
| Class Data | All non-static Class members |
| Virtual Table | Information needed to dispatch virtual functions, access virtual base class subobjects and to access the RTTI information |
| RTTI | Run-Time Type Information used by the typeid and dynamic_cast operators, and exception handlers |
| Typeinfo Name | String representation of Class name |
| Construction Virtual Table | Information needed during construction and destruction of Classes with non-trivial inheritance relationships. |
| VTT | A table of virtual table pointers which holds the addresses of construction and non-construction virtual tables. |
Virtual tables are specified in Section 2.5.3 of Itanium C++ ABI.
Of the various categories of virtual table described in that specification, Category 1 (Leaf) is further described in Figure 7-1 and Category 2 (Non-virtual bases only) is further described in Figure 7-2. LSB conforming systems shall support these categories.
Each type used in a C++ program has a data structure associated with it that provide information about the type which is used at runtime. This Run Time Type Information (RTTI) is defined in section 2.9.5 in Itanium C++ ABI. Additional details about the layout of this data is provided here.
struct {
void *basevtable;
char *name;
void *basetypeinfo[0];
}; |
Figure 7-4. Run-Time Type Information For Classes with no base class
struct {
void *basevtable;
char *name;
void *basetype;
void *basetypeinfo[0];
}; |
Figure 7-5. Run-Time Type Information for Classes with a single base class
struct base_type_info {
char *base_type;
unsigned long offset_flags;
};
struct {
void *basevtable;
char *name;
unsigned int flags;
unsigned int base_count;
struct base_type_info base_info[0];
}; |
Figure 7-6. Run-Time Type Information for classes with multiple inheritance
| <<< Previous | Home | Next >>> |
| Low Level System Information | Up | Symbol Mapping |