"David Abrahams" <david.abrahams@rcn.com> writes: > I don't know what the rules are when there are no virtual functions, > or the virtual functions are inlinied, or the thrown type is a > tempalte which is instantiated implicitly... of course this is OT > for Python-dev but I'm hoping now that I've got the attention of MvL > (a gcc developer) he'll answer these questions or direct me to > someone who can ;-) :-) In these cases, the compiler emits RTTI whenever it is "used", which essentially means when a constructor or destructor is emitted (since those explicitly reference the vtable, which explicitly references the type_info object). Thus, you may end up with multiple copies of the RTTI at the object file level. When combining them into shared objects or executables, when using the GNU linker, the linker will eliminate duplicates as part of the gnu.linkonce processing; other linkers will pick an arbitrary copy as part of the weak symbol processing. At run-time, multiple copies across different DSOs are eliminated by the dynamic loader (ld.so) *if* all those copies are in the global symbol space (RTLD_GLOBAL). During the development of the standard C++ ABI, people thought that those mechanisms will guarantee that symbols can be resolved uniquely at run-time, thus allowing address comparisons for typeinfo object equality. It turned out that this won't work even in cases that are meant to be supported, so the C++ runtime is now back to comparing typeinfo object's .name() strings to establish equality. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4