This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

exception when initialize the .init_array

hello, all:

         we are using the simulator in CCS, and run a mixed C/C++ project, at first, we could run the project ok(elf format). and then we develop some code in the project, but we found the project could not run to main. we did debug step by step and found exeception occurs when initialize the .init_array. it means the following code could not be executed successfully.

__TI_cpp_init() {  

if (__TI_INITARRAY_Base != __TI_INITARRAY_Limit)
   {
      int i = 0;
      while (&(__TI_INITARRAY_Base[i]) != __TI_INITARRAY_Limit)
         __TI_INITARRAY_Base[i++]();
   } 

}

is there any compiler option that trigger this error?

  • What kind of exception?  A C++ exception or a hardware exception?

    What ISA are you using, and what compiler version?  (The compiler version is not the same as the CCS version.)

  • Hi,

    the _TI_cpp_init() call constructor for global level object, that is every object that is defined outside any other function/methods and have a not trivial constructor (not empty)

    Maybe the problem is not in the TI C++ library code but in the constructors of your objects.

    Typical problems are related to the initialization order, that is one ojbect try to use another object (or resource) that is not already constructed.