[PATCH] dynamic_cast and gcc3
Simon Hausmann
hausmann at kde.org
Fri Nov 22 17:23:10 GMT 2002
On Fri, Nov 22, 2002 at 02:50:01AM +0100, Luis Pedro Coelho wrote:
> KLibLoader::library, unlike KLibLoader::globalLibrary, does *not* use
> RTDL_GLOBAL. What I don't understand is how come the dynamic_cast<>s in
> createFactoryFromFactory (called from creat*FromLibrary) work while the ones
> outside do not. It also seems to me that if these casts fail, then no library
> code that calls KPart::Part::loadPlugin(s) will work. Or maybe I am just
> reading the code wrong.
It is my understanding that if a library the application depends on
provides the rtti symbols, then the weak rtti symbols in libraries
opened with dlopen (even without RTLD_GLOBAL) get relocated against
the existing ones (provided that those modules also link against
that library) instead of becoming local ones, hence making rtti work
as expected. That is what I suggested to Matthias. The
ComponentFactory template methods show that it works.
Simon
More information about the kde-core-devel
mailing list