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.

Combine multiple input sections when linking - ccs5 and ELF

Hi,

We have recently moved a large existing code base to ccs5 and switched from COFF to ELF. We also use SYS/BIOS.

We now have to configure the linker using a .bld and .cfg file which is processed during the bios build phase. This produces bios_pe66_x.xdl which is to all intents and purposes a linker command file.

 

Where we used to end up with a single .const section - we now have 1139:

  82e9ace0    82e9ace0    00000001   00000001    r-- .const.1139

A similarly large number of .far and .fardata also.

 

Our sections configuration (via xdc and the .cfg file) is:

 

Program.sectMap[".bss"]="DDR3";

Program.sectMap[".neardata"]="DDR3";

Program.sectMap[".rodata"]="DDR3";

Program.sectMap["xdc.meta"]="DDR3";

Program.sectMap[".text"]="DDR3";

Program.sectMap[".cio"]="DDR3";

Program.sectMap[".ti.decompress"]="DDR3";

Program.sectMap[".text"]="DDR3";

Program.sectMap[".far "]="DDR3";

Program.sectMap[".taskStackSection"]="DDR3";

Program.sectMap[".sysmem"]="DDR3";

Program.sectMap[".cinit"]="DDR3";

Program.sectMap[".init_array"]="DDR3";

Program.sectMap[".ti.handler_table"]="DDR3";

Program.sectMap[".args"]="DDR3";

Program.sectMap[".switch"]="DDR3";

Program.sectMap[".data"]="DDR3";

Program.sectMap[".stack"]="DDR3";

Program.sectMap[".vecs"]="DDR3";

Program.sectMap[".fardata"]="DDR3";

Program.sectMap[".const"]="DDR3";

...

How do I configure the .cfg section above to consolidate all the .const.* sections into a single output section? Same for far and fardata?
My attempts have included:
Program.sectMap[".const {  *(.const) }"]="DDR3";

I would also like to place the .const at the start of DDR3 before the .data and .text
Any help would be gratefully received. I have studied http://www.ti.com/lit/ug/spru186v/spru186v.pdf and spru187t.pdf and spraa46a.pdf 
With all these documents - the xdctools layer on top makes things a little more opaque.
Ian

 

 

 

  • Hi

    The following three statements can put the .const at the start of the DDR3.

    Program.sectMap[".const"] = new Program.SectionSpec();
    Program.sectMap[".const"].loadAddress = 0x80000000;
    Program.sectMap[".const"].runAddress = 0x80000000;

  • Hi Eric,

    thanks for your suggestion. I have added the three statements (slightly modified - we have a reserved section of 0x400 at the start of DDR).

    Program.sectMap[".const"] = new Program.SectionSpec();
    Program.sectMap[".const"].loadAddress = 0x80000400;
    Program.sectMap[".const"].runAddress = 0x80000400;

    Unfortunately now the Linker complains:

    "C:/cygwin/var/tmp/build/ianc-dev-g6-76/ptp700/net_dsp/bios/package/cfg/bios_pe66_x.xdl", line 162: error #10099-D: 

       load placement fails for object ".const", size 0x21bc81 (page 0).  Available

       ranges:

       DDR3         size: 0x1fffec00   unused: 0x1fde2f7f   max hole: 0x1fde2f7f

    error #10010: errors encountered during linking; "DebugNet/net_dsp.out" not

       built

     

  • Hi

    Sorry, I use other section when test the three statements.  For .const, only loadAddress is needed, can't set the runAddress.

  • Hi Eric,

    Thanks again for your reply. It locates fine without the runAddress.

    How can I get .far and .fardata to be contiguous with .const? 

    I now have these sectMaps:

    Program.sectMap[".const"] = new Program.SectionSpec();
    Program.sectMap[".const"].loadAddress = 0x80000400;
    Program.sectMap[".far"] = new Program.SectionSpec();
    Program.sectMap[".fardata"] = new Program.SectionSpec();

    This produces an odd looking linker SECTION for far and fardata

    .far: 
    .fardata:  
    At the moment - .fardata is now locating in L2SRAM. 
    00806000    00806000    00011152   00011152    rw- .fardata
    Ian
  • Hi Ian

    I've no opinion about how to get .far just contiguous with .const in ccs5,  in ccs3.3 there is a link option can do this work, but I didn't find this option in CCS5.  I will try other methods,  and will let you know if solve this problem.