This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -fno-weak, typeinfo, and AIX


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]