other/4878: gcc 3.0.2 output crashes HP-UX linker
John David Anglin
dave@hiauly1.hia.nrc.ca
Sun Nov 4 03:02:00 GMT 2001
> 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)
More information about the Gcc-bugs
mailing list