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.

CCS v3.3 generating 'symbol is defined multiple times' error message

Other Parts Discussed in Thread: TMS320C6421, CCSTUDIO

I am developing an application on a custom hardware platform with a TMS320C6421 DSP. I have a problem related to the Linker. The Code Composer Studio V3.3 Linker is pulling in several libraries, two of which are listed below (i.e. I am NOT explicitly including these libraries). The Linker is complaining about multiple function defines. I’ve copied the messages below. I edited the ‘evmdm6437cfg.cmd’ file by commenting out the rts64pluse.lib and one result was that my app couldn’t divide anymore. I did not try or want to delete the bios library. I’ve also tried checking/unchecking the ‘resolve Symbols to first library’ checkbox under the Linker/advanced tab with no improvement. Can anyone provide an explicit solution. I am not interested in a description of what the error message means or suggestions of getting rid of my heap and replacing my malloc calls with explicit memory allocations. I am also not interested in the 'try this and let me know what happens' approach. I am looking for a professional understanding of the problem and a professional solution from professionals who have created and used Code Composer Studio and the Compiler/Linker tool set.

>>   error: symbol _memalign is defined multiple times: malloc.o64Pe

            (C:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib/bios_NONINST.a64Pe) and memory.obj (C:/CCStudio_v3.3/C6000/cgtools/lib/rts64pluse.lib)

 >>   error: symbol _malloc is defined multiple times: malloc.o64Pe

            (C:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib/bios_NONINST.a64Pe) and memory.obj (C:/CCStudio_v3.3/C6000/cgtools/lib/rts64pluse.lib)

 >>   error: symbol _realloc is defined multiple times: malloc.o64Pe

            (C:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib/bios_NONINST.a64Pe) and memory.obj (C:/CCStudio_v3.3/C6000/cgtools/lib/rts64pluse.lib)

 >>   error: symbol _free is defined multiple times: malloc.o64Pe

            (C:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib/bios_NONINST.a64Pe) and memory.obj (C:/CCStudio_v3.3/C6000/cgtools/lib/rts64pluse.lib)

 >>   error: symbol _calloc is defined multiple times: malloc.o64Pe

            (C:/CCStudio_v3.3/bios_5_31_02/packages/ti/bios/lib/bios_NONINST.a64Pe) and memory.obj (C:/CCStudio_v3.3/C6000/cgtools/lib/rts64pluse.lib)

  • Hi James,

    I am going to move this to the BIOS forums. It would be best for someone who is both very knowledgeable in DSP/BIOS and the RTS to comment on the issue to get the best insight from the start.

    Thanks

    ki

  • With reference to the help info below (extracted from CCS IDE help facility) it looks like there is a Linker bug. The Linker seems to be ignoring the -priority control flag. Any comments? Still looking for a simple solution. I may have to edit the RTS library and remove the functions for malloc, calloc, etc. if that's possible.

     

    The -priority option is used to provide an alternate search mechanism for libraries. –priority causes each unresolved reference to be satisfied by the first library that contains a definition for that symbol.
    For example:

    objfile   references A
    lib1      defines B
    lib2      defines A, B; obj defining A references B

    % cl6x -z objfile lib1 lib2

    Under the existing model, objfile resolves its reference to A in lib2, pulling in a reference to B, which resolves to the B in lib2.
    Under -priority, objfile resolves its reference to A in lib2, pulling in a reference to B, but now B is resolved by searching the libraries in order and resolves B to the first definition it finds, namely the one in lib1.
    This option is useful for libraries that want to provide overriding definitions for related sets of functions in other libraries without having to provide a complete version of the whole library.

    For example, suppose you want to override versions of malloc and free defined in the rts6200.lib without providing a full replacement for rts6200.lib. Using -priority and linking your new library before linking rts6200.lib guarantees that all references to malloc and free resolve to the new library.
    This option is intended to support linking programs with DSP/BIOS where situations like the one illustrated above occur.

  • James,

    Please take a look at the DSP/BIOS UG, section 2.9: Using DSP/BIOS with Run-Time Support Library.  When using BIOS, there is a special versino of the RTS.lib that does not include (duplicate) memory.c, sysmem.c, autoinit.c, and boot.c.

    Let me know if this is the solution.

    Regards,

    Marc