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.

.rodata section incorrectly marked read-write with msp430-elf-gcc using msp430f5529.ld script

In the elf binaries generated by msp430-elf-gcc, rodata should have the READONLY attribute set, otherwise msp430-elf-size counts .rodata as part of .data, causing incorrect SRAM usage estimates. I worked around this by moving the C++ sections (.ctor, .dtor, etc) in .rodata to their own section (see stackoverflow), but  I'm not sure this is correct. In any case it should be patched upstream.

-> % msp430-elf-objdump -h bl.elf

bl.elf:     file format elf32-msp430

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .rodata       000000c0  0000f000  0000f000  000000d4  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  1 __reset_vector 00000002  0000fffe  0000fffe  00000cca  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA