From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Slepuhin To: David Edelsohn Cc: egcs@cygnus.com Subject: Re: egcs on AIX: native or gnu ld? Date: Mon, 20 Oct 1997 05:58:00 -0000 Message-id: <344B5514.EE6B7F7@msu.ru> References: <9710192145.AA33534@rios1.watson.ibm.com> X-SW-Source: 1997-10/msg00867.html David Edelsohn wrote: > > >>>>> Andrey Slepuhin writes: > > Andrey> ld: 0711-319 WARNING: Exported symbol not defined: _GLOBAL_.I.f__Fv > Andrey> ld: 0711-318 ERROR: Undefined symbols were found. > Andrey> _GLOBAL_.I.f__Fv [2] ER DS ccMav3Ma.c(/tmp/ccMav3Ma.o) > > I think that this is an individual constructor. > > Andrey> Manually relinking files once more I obtain correct exexutable (If extra pass > Andrey> is needed why not to do it automatically?). Unfortunately, -frepo option is > Andrey> bad documented :-( > > XLC has a twolink option performs the link phase twice. This > allows the IBM garbage-collecting linker to perform a pass and then > re-examine the global symbols needing export. This frequently is useful > for static contructors. What may happen is that the initial examination > recognizes the symbol as a candidate for export but the linker discovers > that the symbol is not referenced and removes it altogether which then > causes an error because the original pass included it in the list of > exports. The two-pass version only exports those symbols present after > symbol garbage-collection. Indeed, the error was caused by a fact that _GLOBAL_.I.f__Fv symbol is defined in my object file if I use default g++ flags and is undefined if I use -frepo. This symbol is referenced from __CTOR_LIST__ in automatically generated by collect2 code. I don't understand why _GLOBAL_.I.f__Fv is absent in object file when I use -frepo, because this symbol is not connected with template instantiation. Andrey.