Global Constructor Invocation problem at startup

Romil Shah rshah@slscorp.com
Wed May 26 14:27:00 GMT 2004


  Sir,
   I am using gcc compiler 3.3.3 and linker 2.13.2.1, On compilation of my
code for mips architecture , all constructor for the object declared
globally should be invoked based on priority assigned using __attribute__.
All of the constructor based on priority get invoked but then my application
hang up, is this the problem with the ctors and dtors section as shown below
or with the compiler.

The linker script ctor and dtor sections are as follows:-

    #define SECTION_ctors(_region_, _vma_, _lma_)     \
  .ctors _vma_ : _lma_                            \
    {                                             \
      FORCE_OUTPUT;                               \
      KEEP (*crtbegin.o(.ctors))                  \
      __CTOR_LIST__ = .;                \
      PROVIDE (__CTOR_LIST__ = .);                \
      KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))   \
      KEEP (*(SORT(.ctors.*)))                    \
      KEEP (*(.ctors))                            \
      __CTOR_END__ = .;                 \
      PROVIDE (__CTOR_END__ = .);                 \
    } > _region_

#define SECTION_dtors(_region_, _vma_, _lma_)     \
  .dtors _vma_ : _lma_                            \
    {                                             \
      FORCE_OUTPUT;                               \
      KEEP (*crtbegin.o(.dtors))                  \
      __DTOR_LIST__ = .;                \
      PROVIDE (__DTOR_LIST__ = .);                \
      KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))   \
      KEEP (*(SORT(.dtors.*)))                    \
      KEEP (*(.dtors))                            \
      __DTOR_END__ = .;                 \
      PROVIDE (__DTOR_END__ = .);                 \
    } > _region_


SO can you sugggets me the problem which is causing my application to stop
running after invoking the global constructors.
Any help will be highly helpful.

Regards ,
   Romil Shah.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list