Please note this is not a duplicate of #4993, because I am using RTLD_GLOBAL and -Wl,-E.
This test project demonstatrates a problem when using dynamic_cast from inside a shared object to attempt to convert a base class (interface) to a derived class (another interface) whose definitions are in header files shared between the application and the shared object. When casting from a base class to the derived class from inside the main executable, dynamic_cast works as expected and returns a non null pointer. However, from inside of the dlopen-ed shared library, the dynamic_cast function incorrectly returns zero. Attachment will follow. -- Summary: dynamic_cast failure in dlopen-ed shared object Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: daveregs at rsaisp dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19567