-fno-weak, typeinfo, and AIX
Jamie Lokier
egcs@tantalophile.demon.co.uk
Fri Jan 26 07:19:00 GMT 2001
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
More information about the Gcc
mailing list