This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Duplicate data objects in shared libraries
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>, "Martin v. Loewis" <martin at v dot loewis dot de>
- Cc: David Abrahams <david dot abrahams at rcn dot com>, "H . J . Lu" <hjl at lucon dot org>, "drepper at redhat dot com" <drepper at redhat dot com>, "Ralf W. Grosse-Kunstleve" <rwgk at cci dot lbl dot gov>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 19 May 2002 23:29:06 -0700
- Subject: Re: Duplicate data objects in shared libraries
--On Monday, May 20, 2002 06:12:35 AM +0100 Jason Merrill
<jason@redhat.com> wrote:
> Let me try to summarize the discussion:
Thanks; that's helpful.
> I am in favor of doing #1 and neutral to positive on #2. As a possible
> point for further discussion, here is an unofficial patch I whipped up a
> week or so ago to do #2 iff -fpic. YMMV.
What about:
static void f() { struct S { virtual void g(); }; }
There's no guarantee that the name in the RTTI for S will be different
from a similar class in another translation unit -- but it is true that
the NTBS will be at a different address since it will be allocated with
internal linkage.
In other words, is it really true that comparison by address is just
an optimization, and not a correctness issue?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com