Static section initializing

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Nov 25 16:06:28 UTC 2003


On Tue, 2003-11-25 at 16:46, Leon Pollak wrote:
> On Tuesday 25 November 2003 18:03, gregory.menke at gsfc.nasa.gov wrote:
> > IIRC, _init is empty because you don't have quite the right set of
> > system libraries in your link script.  I think you need to include the
> > crtbegin, crtend- which gcc generates.  Look at the motorola_shared
> > bsp's link script- last time I used C++ in RTEMS it handled the
> > constructors properly.
> 
> Gregory, thanks for the hint, but I have something wrong: 
> 	
> 	In my gcc installation (which was downloaded from the RTEMS site 
> powerpc-rtems-gcc (GCC) 3.2.2 (OAR Corporation 
> gcc-3.2.2-20030326/newlib-1.11.0-20030326-2)
> 
>  there are files like crtbegin.o, but they do not contain any _init/_fini 
> symbols. Contrary, there are ecrti.o files which do contain _init/_fini, but 
> these are empty (I made objdump -s).
> 
> 	Do you have any idea where the working _init resides?
They should have been produced by the compiler.

Are you sure to be using 'g++' to *link*? You must use 'g++' instead of
'gcc' or 'ld' to *link* c++ applications. 
What you describe, matches the symptoms of using gcc to link.

Ralf





More information about the users mailing list