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.

Should linker warning #10247-D really be an error

Other Parts Discussed in Thread: MSP430FG439, CC430F5137

I had a CCS Version 5.1.1.00031 installation in which the MSP430 Code Generation Tools had been upgraded to version 4.1.0. I now realize that this was an incompatible combination when selecting an "eabi (ELF)" output format since:

a)  The  MSP430 Code Generation Tools generated a .data section

b) The MSP430 linker command files in CCS Version 5.1.1.00031 didn't contain a .data section

As a result of the .data section not being in the linker command files, the linker did report warning #10247-D:

**** Build of configuration Debug for project MSP430_long_int ****

C:\ti\ccsv5\utils\bin\gmake -k all
'Building file: ../main.c'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=eabi -g --include_path="C:/ti/ccsv5/ccs_base/msp430/include" --include_path="C:/ti/ccsv5/tools/compiler/msp430_4.1.0/include" --define=__MSP430FG439__ --diag_warning=225 --display_error_number --printf_support=full --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
'Finished building: ../main.c'
' '
'Building target: MSP430_long_int.out'
'Invoking: MSP430 Linker'
"C:/ti/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=eabi -g --define=__MSP430FG439__ --diag_warning=225 --display_error_number --printf_support=full -z --stack_size=80 -m"MSP430_long_int.map" --heap_size=300 -i"C:/ti/ccsv5/ccs_base/msp430/include" -i"C:/ti/ccsv5/tools/compiler/msp430_4.1.0/lib" -i"C:/ti/ccsv5/tools/compiler/msp430_4.1.0/include" --reread_libs --warn_sections --rom_model -o "MSP430_long_int.out" "./main.obj" -l"libc.a" "../lnk_msp430fg439.cmd"
<Linking>
warning #10247-D: creating output section ".data" without a SECTIONS
specification
'Finished building target: MSP430_long_int.out'
' '

**** Build Finished ****
The problem is when the linker reports warning #10247-D it seems "random" into which address space the .data section gets placed. e.g.:

a) With a CC430F5137 the .data section got placed in RAM and the program worked.

b) With a MSP430FG439 the .data section got placed in the PERIPHERALS_16BIT area starting at address 0x100, and this caused a watchdog reset in the __TI_decompress_rle_core RTS start-up code before main was entered. An example linker .map file showing this is attached. 

In CCS Version 5.2.0.00069 the MSP430 linker command files have been updated to add the .data section (and others) so the incompatibility has been removed. However, given that if a missing SECTIONS causes the linker to place a section in some "random" address space, should linker warning #10247-D really be an error so highlight the problem?

The comment about  #10247-D being an error applies to the tms470 Arm Code Generation Tools as well as the MSP430 Code Generation Tools. Sections missing TMS570LS202x6SFlashLnk.cmd in CCS 5.1 is where a missing section in a linker command file caused the tms470 linker to place the .stack and .sysmem sections in flash.

  • Chester Gillon said:
    The problem is when the linker reports warning #10247-D it seems "random" into which address space the .data section gets placed.

    Your understanding is basically correct. If there is no section specification in the linker command file telling it where to allocate the section the linker performs some default allocation. It looks like it defaults to the lowest memory range that has sufficient space to allocate the section.

    It is advisable to pay attention to warnings and take action where needed. We keep it as a warning and still allow the executable to be generated because in some cases, such as running on certain simulatosr which use a flat memory model, a very strict conformance to allocating in specific memory may not be necessary. For running on target hardware though it is definitely recommended to have a linker command file that specifies and allocates all compiler generated sections, hence more important to heed such warnings.

    Just another note, you can still copy over/add the newer linker command file to your project using CCS 5.1, CGT 4.1.0.