This is the mail archive of the gcc-bugs@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: 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)


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