This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: shared libraries & exceptions
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: mark at codesourcery dot com
- Date: Tue, 4 Feb 2003 18:32:41 -0600 (CST)
- Subject: Re: shared libraries & exceptions
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
- References: <20030203213737.GC28942@tofu.dreamhost.com>
In article <99150000.1044396061@warlock.codesourcery.com> Mark
Mitchell writes:
> --On Monday, February 03, 2003 01:37:37 PM -0800 Nathan Myers
> <ncm-nospam@cantrip.org> wrote:
>> So the question is, is there any (non-portable!) entry point that
>> can be called by the C code, before or after the dlopen, that will
>> ensure proper initialization of the exception apparatus?
> In GCC 3, it shouldn't make any different what the main program is
> written in. As long as libgcc is linked in, statically or dynamically,
> its initializers will run, and that will set up the exception handling
> stuff for the application. The initializers for the plugin will register
> the right PC range tables and things should be good to go. (Unloading
> the plugin may be more problematic...)
Mark, I believe that your analysis is correct but perhaps only true
for ELF platforms. If someone were to use EH across shared libraries
loaded with dlopen on a non-ELF platform, I'm not sure it works. -Loren