This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ unref symbols
Alexandre Oliva writes:
> On Aug 3, 2000, Petr Ovchenkov <ptr@ParaGraph.Ru> wrote:
>
> > That's was 2.95.2. For later snapshots (mmm, at least since 20000530)
> > for A::A scope instead GLOBAL will be LOCAL (on HP)
>
> I see. AFAIK, WEAK symbols are now supported and used on HP. Maybe
> they just show up as `t' symbols? Or maybe it is indeed some new bug?
I never see WEAK symbols on HP.
c360> uname -a
HP-UX c360 B.11.00 A 9000/785 2002760784 two-user license
And due to native ld fails link when libraries compiled any gcc after
2.95.2, I think that's 't' isn't designate WEAK (I work with GAS).
>
> So, summarizing to the list the discussion we've had in private,
> given:
>
> h.h:
> struct A {
> A() {}
> virtual void f();
> };
>
> x.cc:
> #include "h.h"
> void A::f() {}
>
> y.cc:
> #include "h.h"
> A a;
>
> if you compile x.cc and y.cc without optimization, linking fails
One another issue should be payed attention:
virtual table (and type_info) of A class has local scope, so it still
be unresolved on linkage stage.
c360> c++ -fPIC -shared -o libA.sl -c lib.cc
c360> nm -C libA.sl
00000000 t $CODE$
40000018 d L$C0000
00000000 t A::A(void)
U __rtti_user
00000000 t A type_info function
~~~~~~~~~~~~~~~~~~~~~~
00000008 C A type_info node
40000000 d A virtual table
~~~~~~~~~~~~~~~~~
00000000 t gcc2_compiled.
00000000 T A::qq(void)
> because the constructor is defined as local in x.o and not defined at
> all in y. Is that correct?
Yes. That's what I want to say. Thanks.
- Petr Ovchenkov