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.

Compiler: Linaro tools for ARM cortex A15 (on TDA2xx)



Tool/software: TI C/C++ Compiler

Hello,

We are using (as recommended by TI) the gcc-arm-none-eabi-4_9-2015q3 linaro tools for building (compiling and linking) the ARM cortex A15 cores (on the TDA2xx).

We have some large global arrays defined in the code that are allocated to specific sections (attribute((section ...)), and these sections are defined as NOLOAD sections.

The resulted executable (ELF file) size is small corresponding to the fact that even though the arrays are very large, since the sections are noload section, they do not enter the image file.

The problem is that we noticed that the object files of the sources that have these array definitions are huge in size and it seems that the compiler fills the object files with zero corresponding to the arrays size which result in a very large file.

Even though this does not affect the final image (ELF file) it is still very problematic considering the sizes of these resulted object files.

So far i was not able to find a way to change this compiler behavior and i would appreciate your help for resolving this.

(B.T.W - with the TI compiler tools, which are used for example for the M4 cores, we don't have such a phenomenon with array defined the same way)

Thanks

Guy

Thanks

Guy

  • I can reproduce the problem.  I cannot find a way to avoid the large object file size.  So, I filed an issue with the Linaro support team that supplies this GCC ARM compiler.  Unfortunately, there is no public view of that issue.  When I get a response, I'll post it here.

    Thanks and regards,

    -George

  • Thanks to the folks at Linaro for suggesting this workaround.  Make the array a sub-section of .bss.  For example ..

    int array[10000] __attribute__((section(".bss.array_section_name")));

    For others who may be following this thread ... You can do a similar thing with the TI ARM compiler.  But the string argument to the section attribute has a slight difference ...

    int array[10000] __attribute__((section(".bss:array_section_name")));

    Note that, right after .bss there is a colon (:) and not a dot (.) .

    Thanks and regards,

    -George

  • Thank you very much, this "trick" indeed worked for us.

    B.T.W
    since TI compiler do not seem to have this issue, there was need to use the : syntax for TI compiler and the . syntax could still be used in order to have common source files between TI compiled cores and linaro compiled cores.
    Do you see any problem with this?

    Thanks
    Guy