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]
> The following piece of code will crash HP's system linker
> (B.10.37) when trying to build a shared library:
> 
>   struct X { virtual ~X();  };
>   struct Y { virtual void foo(); };
>   struct W : public X, public Y { virtual void foo(); };
>   struct Q : public W { };
>   void bar() { Q q; }
> 
> I know it mustn't be gcc's fault as /usr/bin/ld is at
> least partly guilty because of it's fatal reaction.
> But where is the real problem ?
> >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:

...
Searching library /usr/lib/milli.a:
/usr/ccs/bin/ld: Unsatisfied symbols:
   vtable for W(data)
   vtable for X(data)
   vtable for Y(data)
   W::foo()    (code)
   X::~X()   (code)
   non-virtual thunk to W::foo()(data)

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]