This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: other/4878: gcc 3.0.2 output crashes HP-UX linker
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: porten at trolltech dot com (Harri Porten)
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Nov 2001 14:41:05 -0500 (EST)
- Subject: Re: other/4878: gcc 3.0.2 output crashes HP-UX linker
[Get raw message]
> On Wed, 14 Nov 2001, John David Anglin wrote:
>
> > > >How-To-Repeat:
> > > g++ -shared -fPIC crash.cpp
> >
> > Adding -Wl,-v to the above g++ command somehow prevents ld from dumping
> > core and provides this bit of additional information:
>
> Thanks for the hint. Doesn't produce any lib output either, does it ?
I played with this a bit more and I think the problem is in collect2.
If you add `-Wl,-debug' to the command, then you get diagnostic output
from collect2. For some reason, it isn't doing the right thing when
when the destructor for X is virtual. The following will link ok
aside from the undefined references:
struct X { ~X(); };
struct Y { virtual void foo(); };
struct W : public X, public Y { virtual void foo(); };
struct Q : public W { };
void bar() { Q q; }
Collect2 is not producing the proper constructor output when the destructor
for X is virtual.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)