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]
Other format: [Raw text]

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


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