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.

Strange issues with the msp430-gcc-opensource 4.1.0.0

Other Parts Discussed in Thread: MSP430F5529, MSP430F5521

Hello,


I recently upgraded my mps430 toolchain to 4.1.0.0 from 3.2.2.0. I'm seeing some rather strange issues. I'd post a bug on the Bugzilla myself, but I'm not entirely sure what's happening with some of these issues.


1. DWARF error, mangled line number section

When an executable is linked with :

/opt/ti/msp430/gcc/bin/msp430-elf-gcc  -Wl,--gc-sections -Wl,--gc-sections -mmcu=msp430f5529 -Wl,-Map,firmware-msp430f5529.map   -T /opt/ti/msp430/gcc/include/msp430f5529.ld CMakeFiles/firmware-msp430f5529.elf.dir/main.c.obj -o firmware-msp430f5529.elf  -L/opt/ti/msp430/gcc/include  <other library object files to be linked>

Both the resulting commands result in a bunch of DWARF errors :

msp430-elf-nm -l -a -S -s --size-sort firmware-msp430f5529.elf > firmware-msp430f5529.sym
msp430-elf-objdump -h -S firmware-msp430f5529.elf > firmware-msp430f5529.lst
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section.
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: mangled line number section (bad file number).



This is also discussed in the later conversation between Orlando Arias and Nick Clifton in bugzilla bug 17940. The strange part, however, is that precisely the same sources, using precisely the same build system and methods and commands, does _NOT_ result in these errors for MSP430F5521. Additionally, changing the linker script (msp430f5529.ld) as discussed there seems to fix the issue:

in msp430f5529.ld
  ...
  /*.debug_line     0 : { *(.debug_line) } */
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  ...


However, msp430f5521.ld also has the same apparant problem. The error just doesn't seem to show up for it :

in msp430f5521.ld:
  ..
  .debug          0 : { *(.debug) }
  ..

2. The following commands both produce DWARF errors. This seems to be a known issue.

$ msp430-elf-objdump -h -D -f -l -S -a libhal-uc-uart-msp430f5529.a > hal-uc-uart-msp430f5529.s
/opt/ti/msp430/gcc/bin/msp430-elf-objdump: Dwarf Error: Line info data is bigger (0xfffffffc) than the section (0x22a)
/opt/ti/msp430/gcc/bin/msp430-elf-objdump: Dwarf Error: Line info data is bigger (0xfffffffc) than the section (0x142)

$ msp430-elf-nm -l -a -S -s --size-sort libhal-uc-uart-msp430f5529.a > hal-uc-uart-msp430f5529.sym
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: Line info data is bigger (0xfffffffc) than the section (0x22a)
/opt/ti/msp430/gcc/bin/msp430-elf-nm: Dwarf Error: Line info data is bigger (0xfffffffc) than the section (0x142)

Are there plans to fix this in the 'official' tools at some point?

  • Shashank,

    I downloaded header files for 3.2.2.0 and 4.1.0.0 (from here:  http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/index_FDS.html) and grep'ed for debug_line in 5521/5529 and I get below:

    ./3.2.2.0/include/msp430f5521.ld:  .debug_line     0 : { *(.debug_line) }
    ./3.2.2.0/include/msp430f5529.ld:  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }

    ./4.1.0.0/include/msp430f5521.ld:  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
    ./4.1.0.0/include/msp430f5529.ld:  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }

    The 3.2.2.0 linker script for 5521 has the bug.  5529 in 3.2.2.0 and the 4.1.0.0 linker scripts have the fix.

    I was not able to find the same 5529 linker script as you posted.

    However, as you have noted, this is an old known issue.  The linker scripts for 4.1.0.0 have the fix.

    Have you tried rebuilding all your project source from 4.1.0.0 tools and linker scripts?

    We always recommend using the latest tools.

    Thanks

    Greg

  • Greg,


    Thanks for the information. This is indeed strange. I was certain I installed the latest tools just a few days ago. I will have to investigate why the linker files did not get updated.

    I'm certain the headers did get updated, since local defines I make in them to help my IDE parse things needed to be added again. Just in case, though, these are the versions I see.

    msp430/gcc$ cat version.properties 
    Version=5.3.0.219
    Vendor=SOMNIUM Technologies Limited


    And :

    msp430/gcc/include$ cat msp430f5529.ld |grep 'Version'
    /* Version: 1.191 */