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.

Compiler/TMS320F28377D: .

Part Number: TMS320F28377D

Tool/software: TI C/C++ Compiler

I'm still dealing with the same fundamental problem described in https://e2e.ti.com/support/tools/ccs/f/81/t/768585, and I want to check in and see if the recommendation has changed or if this has been solved yet.

I need a way to place a specific output section last in a given memory range. I ran into a problem recently where a section where we require this property did happen to be last, but as soon as we increased its size, the linker decided to place it before a section that was slightly smaller. Using the HIGH specifier doesn't do quite what we want either, because it will require using all of the space in that region, regardless of whether we actually need it. The sudden ordering change came as a surprise because it differs from the GNU linker which will place output sections in the order they appear by default; I think the script was originally written with this behavior in mind and the original author happened to get lucky that the "must be last" section was also the smallest, but this is not a guarantee.

  • We do not supply ...

    Christopher Copeland said:
    a way to place a specific output section last in a given memory range.

    But that it is not the request discussed in the older forum thread.  In that thread, the request is stated ...

    My overall goal is to have a symbol that will be placed at the end of all sections in a given memory region (in this case a memory region that corresponds to all flash banks).

    We do have a solution for that request.  It is introduced in compiler release 20.2.0.LTS.  In the MEMORY directive of the linker command file, you can associate a symbol with the last address used in a memory range.  For example ...

    FLASH : origin = 0x0FE000, length = 0x002000, LAST(_symbol_name_here)

    For further details, please search the C28x assembly tools manual for the sub-chapter titled LAST Operator.

    Does this new feature resolve your problem?

    Thanks and regards,

    -George

  • I think this comes close but not quite to solving my problem... I need the symbol that's placed at the end to have actual content, rather than merely be an address that the linker defines. The definition of the symbol I need to place at the end is in a translation unit already, I just need to force it to be placed at the end. The previous post was one approach I attempted at solving this, by having that symbol be in a section that is placed last in a group, however the limitation that all sections in a group have exactly the same placement attributes (not merely that they have the same load address) gets in the way.

    If I use the LAST(_symbol) approach can I also define this in a translation unit and have it have actual data? Can I define additional symbols relative to whatever symbol I specify? What section will _symbol get placed in?

  • Christopher Copeland said:
    If I use the LAST(_symbol) approach can I also define this in a translation unit and have it have actual data?

    No

    Christopher Copeland said:
    Can I define additional symbols relative to whatever symbol I specify?

    No

    Christopher Copeland said:
    What section will _symbol get placed in?

    The symbol specified by LAST has no associated section.  It is an absolute symbol.  Your code can refer to this symbol.  But you cannot make any presumptions about the contents of the memory address the symbol represents.

    Regarding this problem ...

    Christopher Copeland said:
    The definition of the symbol I need to place at the end is in a translation unit already, I just need to force it to be placed at the end.

    I have considered this question at some length.  So far, I've come up empty.  Unfortunately, I don't think there is way to do it.

    Thanks and regards,

    -George