This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Global object initialisation doesn't work ??
- From: James E Wilson <wilson at specifixinc dot com>
- To: kavii ita <systemonchip2000 at yahoo dot co dot in>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 09 Nov 2004 18:49:00 -0800
- Subject: Re: Global object initialisation doesn't work ??
- References: <41052CA6.3000606@OARcorp.com> <20041105071331.32674.qmail@web8506.mail.in.yahoo.com>
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