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.

AM4372: Define multiple same section in .cmd file

Part Number: AM4372

Hi all,

I'm using compiler "TI v16.9.3.LTS".

Can I define two text sections as below and place them in internal RAM and DDR0 respectively?

Best regards,

Sasaki

  • Before I answer your question, please note that this ...

        .text {
            test.obj
        } > DDR0

    ... means that all of the input sections (such as .bss, data, and so on) in test.obj are added to that output section named .text.  It is doubtful that this is what you want.  It is likely you mean to write ...

        .text {
            test.obj(.text)
        } > DDR0

    ... instead.  This means that only the .text input section from test.obj is placed in this .text output section.  The other input sections (.bss, .data, and so on) are thus combined with output sections that have the same name.  

    S.Sasaki said:
    Can I define two text sections as below and place them in internal RAM and DDR0 respectively?

    Yes.  But that could cause confusion later.  Avoid that by giving each output section a unique name.  In this case, something like ...

        .special_name_here {
            .test.obj(.text)
        } > DDR0

    For more usage tips on linker command files, please see the article Linker Command File Primer.

    Thanks and regards,

    -George

  • Thank you for your information!
    I got it!

    By the way, if I describe as below and place .bss & .data etc in .text, will the device work properly?

    .text {
    test.obj
    } > DDR0

    Best regards,
    Sasaki
  • S.Sasaki said:
    if I describe as below and place .bss & .data etc in .text, will the device work properly?

    That depends on details of how the hardware works in that configuration.  I lack the expertise to answer.

    Thanks and regards,

    -George

  • Even if it turns out to be legal to put .bss and .data into .text, you probably shouldn't. It is probably OK to put .bss and .data into DDR0, but .bss and .data and .text have very different properties, and downstream tools may get confused if everything is named ".text"
  • Thank you for your information!