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.

Linker - Reading size of a section from different command (.cmd) file

Hi,

I am trying to place a memory section right after an interrupt vector table section, which is defined in a separate .cmd file.

So far I had no luck and would greatly appreciate your help.

Below is a theoretical content of two .cmd files to present what I am trying to achieve.

a.cmd

SECTIONS
{
    .resetVecs: load > 0x00000000
....

}

b.cmd

SECTIONS
{
    .infoheader: > 0x00000000 + SIZE(.resetVecs)         //this is supposed to place .infoheader right after .resetVecs.
....

}

I cannot put everything in one .cmd file because the first one gets generated automatically by TI-RTOS.

Is there a way to achieve such an alignment of memory sections?

Thank you very much,

Peter A.

  • Peter,

    Sorry, this was bumped back to the TI-RTOS forum.  Emailing with the codegen team, there was mention of the GROUP directive, which I hadn't tried.  I just did, and it worked for me.

    Can you try using this in the top-level linker command file:

    SECTIONS
    {
        GROUP : load = 0x0
        {
            .resetVecs
            .infoheader
        }
        .text   :   > FLASH
        .const  :   > FLASH


    Does this accomplish what you’re looking for?

    Thanks,
    Scott

  • Hi Scott,
    Thank you for your response. This solution does exactly what I wanted.

    Thank you,
    Peter A.