[ECOS] __CTORS__

Rafael Rodríguez Velilla rrv@tid.es
Thu Dec 7 02:38:00 GMT 2000


  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





More information about the Ecos-discuss mailing list