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.

Global object without calling the constructor

I have a large project which needs ndk , openmp .etc, so I use the image_processing_openmp_evmc6678l.cfg as my RTSC cfg file. And there is a global object in .cpp file, but its  constructor has never been called( I set a breakpoint in constructor).A warning occurs when I builded the project:

"./configPkg/linker.cmd", line 175: warning #10237-D: split placement (>>) ignored for ".init_array":  split placement for this section is not permitted

Then I develop a  test project with simple configure in cfg file and the warning disappears. Also, the constructor is correctly called before enter to main().

What may cause this warning and make the constructor  not called?

  • I know why you see that warning.  I do not know why the constructor does not get called.

    Here is a brief description of section splitting.  More is contained in this application note.  The important point is that certain compiler generated sections, .init_array among them, cannot be split.  The compiler assumes all parts of .init_array from separate object files are combined together into a single output section.  As the warning says the split is ignored, so it should not cause any problems.  Does the link otherwise succeed?

    Look at the map file, the lines for the .init_array output section, does it include a contribution from the C++ file that contains the definition of the object which is not getting constructed?

    Thanks and regards,

    -George

  • Hi George,

    The link is ok except the warning. I look at the map file in .init_array, it seems to ok:

    .init_array
    * 0 a021d6c4 00000018
    a021d6c4 00000004 base.obj (.init_array)
    a021d6c8 00000004 child1.obj (.init_array)
    a021d6cc 00000004 child2.obj (.init_array)
    a021d6d0 00000004 main.obj (.init_array)
    a021d6d4 00000004 rts6600_elf_mt.lib : iostream.obj (.init_array)
    a021d6d8 00000004 : locale0.obj (.init_array)

    But the constructor does not get called certainly.I have provided the two map file.2742.map.rar

  • Are you trying to run C++ code under OpenMP?  That is not supported.

    Thanks and regards,

    -George

  • Hi George,

     I have never heard that C++ is not supported by OpenMp. So,any TI's  user guide said it explicitly? If so,How can I develop the parallel program in C++.

    Best regards,

    guohua

  • The README.txt file in the root directory of the version 7.4.7 C6000 compiler says ...

    Please note that use of the OpenMP API in C++ applications is not fully supported at this time.

    Thanks and regards,

    -George