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.

CCSTUDIO: C29 linker file requirements for compilation with LTO

Part Number: CCSTUDIO

Hello TI team,

We are working with CCS 20.0.2.5 and TI Clang V2.1.0.STS. If we understand correctly this compiler version actually implements LTO. Our projects linker file describes a number of sections in the following manner:

    .asection: {
        obj1.o(.rodata,.const,.text,.switch,.cinit)
        obj2.o(.rodata,.const,.switch,.cinit)
        obj3.o(.rodata,.const,.text,.switch,.cinit)
    } > RAM_CPA_CPU1, palign(8)

Is it correct to refer to objects when compiling with LTO enabled or do we have to use __attribute__((section ("asection"))) for every function and variable to place them where we need in memory?

Regards, Dmitri

 
  • Hello,

    I have brought this thread to the attention of the compiler experts as they will be able to assist best.

    Thanks

    ki

  • Hi Dmitri,

    No,  you do not need to use the section attribute.  LTO will work with your existing linker command file, but in order for it to work, your project must separate the compilation and link steps into two different steps.  This avoids the compiler's use of temporary file names that obscure the object file name -- the next production of the release of the compiler will remove that restriction.

    -Alan