This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: __CTOR_LIST__
- To: ian at zembu dot com
- Subject: Re: __CTOR_LIST__
- From: Tony Kimball <alk at pobox dot com>
- Date: Mon, 2 Jul 2001 13:37:56 -0500
- Cc: alk at pobox dot com, binutils at gcc dot gnu dot org
- References: <15165.16007.509486.880965@spanky.love.edu><sivglcdogq.fsf@daffy.airs.com>
- Reply-To: alk at pobox dot com
Quoth Ian Lance Taylor on , 1 July:
:
: x86 Linux normally uses ELF. In ELF, global constructors are normally
: handled by putting the address of the constructor in the .ctors
: section. When doing a final link, the compiler will include
: crtbegin.o and crtend.o in the link. These will fill in the
: definition of __CTOR_LIST__.
:
: Try compiling a trivial C++ program with a constructor. You will see
: that the compiler puts the address of the global constructor in the
: .ctors section.
This looks tantalizingly like the beginning of some very helpful
information, but I am still missing one crucial piece: How do the
addresses in the .ctors sections get put into the __CTOR_LIST__? I
don't see any code in crtstuff.c to do this, nor have I been able to
detect collect2 or ld doing this.