This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Global object initialisation doesn't work ??


kavii ita wrote:
My g++ compiler doesn't generate the .ctor and dtor
sections.

There are many different ways to implement static constructors, and many different things that can go wrong. Without more info, we can't do anything to help you.


We need to know what the target is. We need to know how you are compiling it. We need to know what if any changes you have made to gcc. Etc. We need to know everything necessary in order for one of us to reproduce the problem you are seeing.

Using gcc-3.3.3, the testcase works for me on an x86_64-linux system. I don't see anything obviously wrong.

>I came to know that crtbegin, crtend ojects are needed
>to be linked for c++. Is this right?

For most ELF targets, yes. But the compiler takes care of this for you, so this isn't something you should need to worry about. Unless maybe you are writing your own port, but you didn't mention that.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]