Re: Strange __cxa_pure_virtual problem

Uwe Kindler <[email protected]>
Newsgroups gmane.os.ecos.devel
Message-ID <[email protected]>
Hi Bart,

here you will find some linker maps:

http://www.cetoni.de/ecos_ld_maps_20090813.zip

> What happens if you then try to link a trivial eCos application which
> declares a static string object? I suspect that is going to pull in
> __cxa_guard_release() again, which will take its __cxa_pure_virtual()
> from libsup++.a instead of libtarget.a. So deleting the static from
> the declaration is only moving the problem, not solving it.
> 
> Bart
> 


1.

I compiled a trivial eCos application (only a main function) which 
declares a static ustl string object. You will find the linker map in 
the zip archiv (ecos_app_ustl.map). I used the same eCos config that 
crashed on building the diag_printf1() test.

The application is build properly. You are right - it pulls in the 
__cxa_guard_release() and __cxa_pure_virtual() from libsupc++.a.

2.

I did not changed anything in the main function but added the class 
declarations and implementations of the cxxsupp.cxx test in front of the 
main function but did not created any object of these classes. The 
linker map is in the zip archive (ecos_app_ustl_pure.map).

All the __cxa_.... stuff like __cxa_guard_release() is still pulled in 
but now the application uses the __cxa_pure_virtual() from infra/pure.cxx.

(/home/Nutzer/ustl_test_0q_nofio_install/lib/libtarget.a(infra_pure.o)
                               twothreads.o (__cxa_pure_virtual))


3.

I created a default eCos library (template default). I compiled a 
trivial eCos application that contains a main function and in front of 
the main function the class declarations and implementations of the 
cxxsupp.cxx test. In the main function I declared a static object of 
type Derived:

int main(int argc, char *argv[])
{
     static Derived deriv(1);
...

The linker map is in the zip archive (ecos_app_default.map).
All the __cxa_.... stuff like __cxa_guard_release() is still pulled in 
but now the application uses the __cxa_pure_virtual() from 
infra/pure.cxx. That means no uSTL stuff but all __cxa_... stuff present.


Summary:

As soon as I declare a static object of a class with pure virtual 
functions, a lot of __cxa_... stuff is pulled in from libsupc++. This 
does not depend on uSTL package.

If the static object is a string from uSTL package, the 
__cxa_pure_virtual() function from libsupc++ is used. If the class 
declaration is part of the application then the __cxa_pure_virtual() 
from infra/pure.cxx is used.

Do you have any suggestions how to continue with uSTL package integration?

Regards, Uwe


http://www.cetoni.de/ecos_ld_maps_20090813.zip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.