This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fno-weak, typeinfo, and AIX
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: -fno-weak, typeinfo, and AIX
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Fri, 26 Jan 2001 16:18:47 +0100
- Cc: gcc at gcc dot gnu dot org, Jason Merrill <jason at cygnus dot com>
- References: <20010125161745K.mitchell@codesourcery.com>
Mark Mitchell wrote:
> - Modify the run-time library to do a string comparison, not an
> address comparison, of the typeinfo strings.
You can make the typeinfo object a pointer to the string and coalesce
strings at run time. The typeinfo would contain another pointer to link
together all the initialised typeinfos.
Typeinfo comparison would reduce to comparing two pointers from memory,
which is nearly as fast as address comparison.
> [...] the weak symbols approach works much more smoothly.
It does as long as you don't use dynamic loading.
Consider this:
1. Load libA.so -- defines typeinfo A.
2. Load libB.so -- also defines typeinfo A, the one in libA.so wins.
3. Unload libA.so -- still with references to typeinfo A from libB.so.
Oh dear. We have an address in unmapped memory. Maybe something will
get mapped in it later, such as typeinfo C from libC.so.
Thoughts?
-- Jamie