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.

Issue with retain linker option for sections

Other Parts Discussed in Thread: SYSBIOS

Hello everyone,

Target is C6678, compiler is 7.4.11, SYSBIOS is used.

In my rtos config file I have

Program.sectMap[".DDR3appli"]                 = "DDR3";

I have a C file which defines variables like this  :

#pragma SET_DATA_SECTION(".DDR3appli")

int mydata;
short mydata2;

#pragma SET_DATA_SECTION()

This file is compiled (along other files) for each core of the DSP (8 in total)

Note that some cores DO NOT use mydata or mydata2.

As these variables are in shared memory we still want these cores to know that these variables exist in shared memory (for use by other cores).

When linking for each core we use the --retain=.DDR3appli option.

Unfortunately when we look at the memory map of the cores that DO NOT use mydata or mydata2, they don't have these 2 symbols mapped, despite the "retain" instruction.

Regards,
Clement

  • It might be due to the syntax you are using for the --retain option.

    When specifying section names to be retained, the syntax needs a file specifier then the section. For eg,

    --retain=filename.obj(.DDR3appli)

    or to retain .DDR3appli from all files:

    --retain=*(.DDR3appli)

    The C6000 Assembly Language Tools Users Guide describes the supported forms for the --retain option. Please give this a try and let us know if it works.

  • Hello AartiG,

    It wasn't obvious to me to look at the Assembly language tools UG for the documentation of --retain.

    Anyway the true syntax to retain .DDR3appli from all files is :

    --retain='*(.DDR3appli)'

    Quotes are mandatory when wildcards are used.

    Regards,
    Clement