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.

Size of binary when using STL

Other Parts Discussed in Thread: CCSTUDIO

Hello,

I have quite the same question as in thread size of out-file strip6x and relocation template-symbols , except that I found what seems to trig the issue.

The issue: in the out file, created from a project without any debug information, even after a call to "strip6x -p", are embedded some templates names in clear ascii, as well as build options.

For instance, if I just add the following include -not even using a method from it- in a cpp file : #include <streambuf> ,  here is the extra text added at the end of the out file (I only added line return for display purpose)

MyFile.cpp  
-pdsw225  
-o3  
-frD:/WS/MyWorkarea/software/applications/Appli/CCS/Release/app_ReleaseStApp  
-iD:/WS/MyWorkarea/software/libraries/framework/types/includes  
-uUSE_SDR  
-mf5  
-mv6400+  
-iC:/Win16App/CCStudio_v3.3/C6000/csl/include  
-iC:/Win16App/CCStudio_v3.3/C6000/xdais/include  
-iC:/Win16App/CCStudio_v3.3/bios_5_33_06/packages/ti/bios/include  
-iC:/Win16App/CCStudio_v3.3/bios_5_33_06/packages/ti/rtdx/include/c6000  
-iC:/Win16App/Texas_Instruments/C6000_Code_Generation_Tools_6.1.11/include
0D:\WS\MyWorkarea\software\applications\Appli 
Bnpos__Q2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std18allocator__tm__2_c
Bcollate__Q2_3std17_Locbase__tm__2_i
Bctype__Q2_3std17_Locbase__tm__2_i
Bmonetary__Q2_3std17_Locbase__tm__2_i
Bnumeric__Q2_3std17_Locbase__tm__2_i
Btime__Q2_3std17_Locbase__tm__2_i
Bmessages__Q2_3std17_Locbase__tm__2_i
Ball__Q2_3std17_Locbase__tm__2_i
Bnone__Q2_3std17_Locbase__tm__2_i
B_Psave__Q2_3std41_Facetptr__tm__24_Q2_3std14ctype__tm__2_c
Bskipws__Q2_3std14_Iosb__tm__2_i
Bunitbuf__Q2_3std14_Iosb__tm__2_i
Buppercase__Q2_3std14_Iosb__tm__2_i
Bshowbase__Q2_3std14_Iosb__tm__2_i
Bshowpoint__Q2_3std14_Iosb__tm__2_i
Bshowpos__Q2_3std14_Iosb__tm__2_i
Bleft__Q2_3std14_Iosb__tm__2_i
Bright__Q2_3std14_Iosb__tm__2_i
Binternal__Q2_3std14_Iosb__tm__2_i
Bdec__Q2_3std14_Iosb__tm__2_i
Boct__Q2_3std14_Iosb__tm__2_i
Bhex__Q2_3std14_Iosb__tm__2_i
Bscientific__Q2_3std14_Iosb__tm__2_i
Bfixed__Q2_3std14_Iosb__tm__2_i
Bboolalpha__Q2_3std14_Iosb__tm__2_i
B_Stdio__Q2_3std14_Iosb__tm__2_i
Badjustfield__Q2_3std14_Iosb__tm__2_i
Bbasefield__Q2_3std14_Iosb__tm__2_i
Bfloatfield__Q2_3std14_Iosb__tm__2_i
Bgoodbit__Q2_3std14_Iosb__tm__2_i
Beofbit__Q2_3std14_Iosb__tm__2_i
Bfailbit__Q2_3std14_Iosb__tm__2_i
Bbadbit__Q2_3std14_Iosb__tm__2_i
B_Hardfail__Q2_3std14_Iosb__tm__2_i
Bin__Q2_3std14_Iosb__tm__2_i
Bout__Q2_3std14_Iosb__tm__2_i
Bate__Q2_3std14_Iosb__tm__2_i
Bapp__Q2_3std14_Iosb__tm__2_i
Btrunc__Q2_3std14_Iosb__tm__2_i
B_Nocreate__Q2_3std14_Iosb__tm__2_i
B_Noreplace__Q2_3std14_Iosb__tm__2_i
Bbinary__Q2_3std14_Iosb__tm__2_i
Bbeg__Q2_3std14_Iosb__tm__2_i
Bcur__Q2_3std14_Iosb__tm__2_i
Bend__Q2_3std14_Iosb__tm__2_i
B_Stz__Q2_3std13fpos__tm__2_i

From -pdsw225 to -mv6400+ are the build options of the project compiling MyFile.cpp

If I remove the include, it still compiles as I'm not using any method out of it, but all the symbols listed above are not embedded in the out file, and thus the binary is lighter.

Our project has many CPP files, which are using -and thus including- STL headers. At the end, it represents about 2MB of plain ASCII character out of 4MB !!!

Tools version:

  • CCS 3.3.82.13
  • strip6x : 6.1.11

Any idea how to remove those strings out of the out file ?

Regards,

Aymeric

  • I can reproduce this behavior for COFF files, but not for ELF files.  This seems to agree with the options you show, which do not include --abi=eabi.

    These strings seem to be in the .template section, which is a helper section for the linker to allow it to handle C++ template instantiation.  (Use ofd6x on the executable file to see that the section exists.)  There is no need for this section after linking is complete, but strip6x seems to be unable to remove it.  If you use EABI, this section is not used, and these strings do not appear.

    I can see no other method for getting rid of these strings than switching to EABI with the option --abi=eabi.

    The .template section is meta-information; its content does not show up in target memory, so it doesn't affect the footprint of the program.

    I've submitted SDSCM00045837 to track this issue.

  • Thanks  Archaeologist for the answer.

    On a stripped binary (still using strip6x -p), that's right, there's a template section of size 0x1AE7B0 : this is around 1.7 MB.

    I can't find the ABI options within the build options window... Did I miss something, or isn't it available on CCS 3.3 ? Also, in which document could I find more explanation about EABI mode ?

    Thanks in advance,

    Aymeric

  • Start with http://processors.wiki.ti.com/index.php/EABI_Support_in_C6000_Compiler

    EABI support is available with C6000 compiler version 7.x and above.  I believe it is possible to install this version of the compiler under CCS 3.3, but I don't whether that is an officially supported combination.

  • I am running into the same issue but unfortunately I cannot switch to EABI due to use of CSL and SYS/BIOS libraries that do not appear to be available in EABI format for my target (641x). (I'd be happy to be wrong about that since I'd very much prefer to use ELF instead of COFF.)

    Has there been any progress on fixing SDSCM00045837 for 7.4.3 or 7.5?

    This is a major issue for my project.

    --Adam

  • SDSCM00045837 has been classified an enhancement, which means it will not be fixed for 7.4.x.  However, it has been implemented, so it will be available in the next branch.  I do not know if that number will be 7.5.x or not.

  • Hello Adam,

    on our side, the only valid solution matching our planning & needs was to develop a tool similar to strip6x which additionally removes the template section (as well as debug sections,  unneeded strings and symbols...).
    You can rely on http://www.ti.com/lit/an/spraao8/spraao8.pdf for writing it.

    Maybe this workaround could be enough for you: mount a virtual drive on your workarea so to reduce the path length ; this way the paths contained in the out file will be as short as possible.

    Regards,

    Aymeric