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.

C6000 - fill in linker cmd file

Hi Champs,

im trying to initialize a data section to 0 in the linker command file. I'm using the method as described in SPRU186W, Example 7‑25. Linker Command File, demo.cmd.

ctrl_vars: /* Create new ctrl variables section */
{
ctrl.obj(.bss) /* here I'm using test.lib instead of ctrl.obj */
} = 0x00000100 > SLOW_MEM /* Fill with 0x100 and link into RAM */

The only difference to the example is that I'm using a .lib

When b uilding I get the error message expecting output section, GROUP, or UNION
Any idea what's going wrong? Is there a workaround for that?

Kind regards,

one and zero

  • Hi Champs,

    seems like changing to:

    ctrl_vars: /* Create new ctrl variables section */

    {

    ctrl.obj(.bss) /* here I'm using test.lib instead of ctrl.obj */

    } fill = 0x00000100 > SLOW_MEM /* Fill with 0x100 and link into RAM */

    fixes the issue (adding the fill option). I do not get an error from the linker anymore. However the fill value is discarded and 0 used instead.

    Could someone please confirm?

    Thanks,

    one and zero

  • I apologize for the delay.

    I filed SDSCM00051458 in the SDOWP system to request that the example in manual be changed to ...

    ctrl_vars: /* Create new ctrl variables section */
    {
        ctrl.obj(.bss) /* here I'm using test.lib instead of ctrl.obj */
    } > SLOW_MEM, fill = 0x00000100 /* Fill with 0x100 and link into RAM */
    

    That works in the test case I tried.

    The syntax you tried is a bit different.  And you see this...

    one and zero said:

    However the fill value is discarded and 0 used instead.

    Could someone please confirm?

    When I write it the way you show above, it works as expected.  How do you know the section is filled with 0?

    Thanks and regards,

    -George