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


On Fri, Jan 26, 2001 at 04:18:47PM +0100, Jamie Lokier wrote:
> 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.
> 

I don't think it is a problem for glibc. Bascially, libA.so won't
get unloaded with dlclose () since there is still a reference to
libA.so. BTW, you don't need typeinfo for that to happen.


-- 
H.J. Lu (hjl@valinux.com)

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