Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

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

$
0
0

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


Viewing all articles
Browse latest Browse all 262198


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>