This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
__CTORS__
- To: ecos <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] __CTORS__
- From: Rafael Rodríguez Velilla <rrv at tid dot es>
- Date: Thu, 07 Dec 2000 11:32:32 +0100
- Organization: Telefónica I+D
I'm analyzing the ARM PID initialization of eCos and I have seen that
the routine that calls the constructors (cyg_invoke_constructors) is the
following:
typedef void (*pfunc) (void)
extern pfunc __CTOR_LIST__[];
extern pfunc __CTOR_END__[];
void cyg_invoque_constructors(void)
{
pfunc *p;
for (p=&__CTOR_END__[-1];p >= __CTOR_LIST__;p--)
(*p) ();
}
I have search what these extern symbols are (__CTOR_LIST__ and
__CTOR_END__). I found it at the linker script arm.ld.
Can anybody explain me which constructors are referenced at
__CTOR__LIST__ and what does it means when you reference it with
brackets? The symbol at arm.ld is just __CTOR_END__, but at this routine
is called with __CTOR_END__[-1].
Is there any place where I can read about where gcc and g++ places
each part of the code (with an explanation about every section of the
linker script)?
--
Rafael Rodríguez Velilla rrv@tid.es
Telefónica I+D http://www.tid.es
Telf: 34 - 1 - 91 337 4270