Post Go back to editing

Having a word adressable data buffer in PM memory via "seg_pmda_nw" produces linker error


we use ADSP-21573 and would like to place a data buffer in word addressable PM memory like this:

float pm audio_buffer[NUM_SAMPLES_PER_BUFFER];

but it produces the following linker error:

[Error li1060]  The following symbols are referenced, but not mapped:
        'audio_buffer.' referenced from src\audio.doj(seg_swco)

Tried sections "seg_pmda" and "seg_pmda_bw" without linker errors.
Is there something missing in our LDF ?

Thanks in advance,


  • Hi David,

    By default, the compiler places static and global variables in the Data Memory data section. The compiler’s pm keyword (memory type qualifier) lets you override this default and place variables in the Program Memory data section. If a memory type qualifier is not specified, the compiler places static and global variables in Data Memory.

    The following example allocates an array of 10 integers in the PM data section.
    static int pm coeffs[10];

    Therefore please note that, declaring variable/data using compiler’s pm keyword as below, will automatically places varaiable in PM memory section(no need to specify section name in source file).Please refer the attached screenshot "map_seg_pmda.JPG".

    float pm audio_buffer[NUM_SAMPLES_PER_BUFFER];

    For more information, please refer in CCES help:

    CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > C/C++ Compiler Manual for SHARC® Processors > Compiler > C/C++ Compiler Language Extensions > Dual Memory Support Keywords (pm dm)

    CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > C/C++ Compiler Manual for SHARC® Processors > Compiler > C/C++ Run-Time Model and Environment > Memory Section Usage > Data Storage in Program Memory


  • Thanks for your reply.

    I know about the compiler's default behaviour and the usage of the 'pm' keyword.
    As written in my original post I am using the keyword and what I want to achieve is the mapping to a certain area within program memory which is word addressable.

    Trying section 'seg_pmda_nw' does not work and produces a linker error.
    So how may I annotate / specify a symbol to be placed in word addressable program memory ?

    Thanks & Regards,

  • Word-addressed variables and functions need to be defined in word-addressed source files, i.e. files compiled with -char-size-32. No section qualifier is required when doing that.

    Such variables and functions can be referenced from a byte-addresed source file (i.e. one compiled with -char-size-8), by annoting their extern declarations with #pragma word_addressed, but they cannot be defined there.

    Kind regards,

  • Thank you very much for your reply Andy.

    I thought section qualifiers 'seg_dmda_nw' and 'seg_pmda_nw' are exactly for this purpose (defining addressability) or am I wrong about this ?
    Also, 'seg_dmda_nw' works just fine, no linker error and the symbol is defined in a file which is not compiled with char size 32, but the buffers are word addressable as far as I can see.

    Any help for clarification would be welcome,
    Thanks in advance & Regards,


  • The section qualifier is intended for placing data and code into sections with different names (and placement), but they still need to have the type the compiler expects. All variables defined in -char-size-8 source files do need to be placed into byte-addressed output sections.

    In the assembly code the compiler generates with -char-size-8, data section will have the byte-addressed type (which in the .SECTION directive in assembly is expressed either with the BW qualifier or by omitting the type qualifier). Such a byte-addressed input section cannot be mapped to a word-addressed output section in the LDF. Attempts to do so will be skipped over, thus eventually resulting in the 'symbol not mapped' error you saw in your original post.

    To complicate matters though, seg_dmda_nw is an exception to this. For internal implementation reasons, this section is hardcoded to be emitted as type DM, i.e. word-addressed, in the compiler-generated assembly code. Therefore, when using '#pragma section("seg_dmda_nw")' you actually get an error saying 'The section name seg_dmda_nw is reserved for use by the compiler', but unfortunately that error is not emitted when the 'section("seg_dmda_nw")' qualifier is used instead of the #pragma. We've got an issue open for that.

    While code using 'section("seg_dmda_nw")' will indeed link, it still won't work properly because the variable will be four times as big as intended and code accessing it may use incorrect address offsets.

    More information on mixing byte and word addressing can be found in this section of the CCES help:

    SHARC Development Tools Documentation > C/C++ Compiler Manual for SHARC Processors > Compiler > Using Byte-Addressing > Mixed Char-Size Applications

  • Hi Andy,

    once again thanks for your helpful awnsers and detailed information !

    Following your suggestions I put all those buffers to be word addressable into a separated file which per setting will be compiled with '-char-size-32'.
    Files which reference those buffers do kind of  'extern pm/dm type * word_addressed identifier'.
    No linker errors or address calculation errors no more.

    Thanks & Kind Regards,