GCC 3.2.2 (OAR build) question

leonp at plris.com leonp at plris.com
Tue Feb 28 11:49:47 UTC 2006


On Tuesday, 28 בFebruary 2006 13:44, you wrote:
> Leon,
>
> since nobody else answered yet: 
Most of them probably are sleeping...:-))

> I am not a C++ guru, but maybe your 
> linker command file misses a section for the global constructors?
No, all the rest constructors do appear in __CTORS__, but they are called "by 
name".

> AFAIK gcc would add an entry in the global constructor table for  your
> object (this should be visible in the a.o file).
Exactly, this is what I found - the line 00000B with the constructor name.

> This really is a wild guess, but maybe it helps.
Anyway, thank you for your will...
>
> best wishes,
> Thomas.
>
> leonp at plris.com wrote:
> > Hello, all.
> >
> > Please, forgive me for 99% off-topic question, but as I use not "native"
> > gcc...:-))
> >
> > I have the following very strange gcc problem - in the file a.cpp there
> > is some cCL class declaration and also global object CL is created. The
> > constructor of the class inserts 'this' pointer into a global array pCLs.
> > This array is declared system wide and all usage of the object therefore
> > is done using this pointer and the object is never referenced directly.
> >
> > Now, when everything is linked in - the 'a' object module is never used!
> > I checked the a.o content - there is an object CL (record of type 000B)
> > and everything looks OK, but the executable has no a.o at all in its map
> > file (and nothing works obviously).
> >
> > Just for experiment, I added the following into a.cpp: 'volatile int
> > x;' (global var declaration) and 'extern volatile int x' into main.cpp.
> > Magic! Now everything is OK - CL constructor was added into CTORS, all
> > functions appeared in the map file.
> >
> > Can someone help me to understand where the first variant is incorrect?
> > Many many thanks ahead.

-- 
Dr.Leon M.Pollak
Director
PLR Information Systems Ltd.



More information about the users mailing list