This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: dlopen() and placing exception body in .cpp file
- From: Ian Lance Taylor <iant at google dot com>
- To: Dimitri Tcaciuc <dtcaciuc at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Aug 2010 16:51:55 -0700
- Subject: Re: dlopen() and placing exception body in .cpp file
- References: <AANLkTikFGwQY0tAeRTUyLj+0spR=ayjHSeqnXiBsCobm@mail.gmail.com>
Dimitri Tcaciuc <dtcaciuc@gmail.com> writes:
> Now, according to `dlopen` manual, I have to load with RTLD_GLOBAL for
> RTTI to function properly.
Yes. Anything else is unsupported. Even if we explain how it all works
today, it may change tomorrow.
Basically, it works by doing pointer comparisons on the RTTI
information. That works reliably when using RTLD_GLOBAL. When using
RTLD_LOCAL, whether it works depends on exactly where the code creating
the object runs, because where that code runs determines which pointer
it will get when it refers to the symbol containing the type
information.
Ian