[LLVMdev] RTTI handling

John McCall rjmccall at apple.com
Fri Sep 30 10:22:02 PDT 2011


On Sep 30, 2011, at 9:15 AM, Somorjai, Akos wrote:
> I was wondering how llvm and clang handles the RTTI shared libraries issue mentioned here: http://gcc.gnu.org/faq.html#dso

This is really a Clang question and so belongs on cfe-dev.

> Is it using name or address comparison?

Clang strives for interoperability with GCC, which means we use address comparison on targets where GCC does.  Therefore yes, we have the same issues with symbol visibility and vague linkage.

> We have an architecture with several frameworks and plug-ins; some of the latter are being loaded and unloaded runtime.
> In the past that issue caused crashes in our app, so at the moment we are overriding __dynamic_cast to detect this problem, but that's kind of messy. I'm hoping for a better solution with llvm…

The best solution, bar none, is to avoid the need for vague linkage on your RTTI objects.  If they correspond to polymorphic class types, which presumably they do if your problems are with dynamic_cast, then you need to use key functions more effectively.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110930/04d930f7/attachment.html>


More information about the llvm-dev mailing list