ld script: named section for const part of .data?

Oct 07, 2011 1 Replies

Hi,



I have an ld script for a statically linked application. The section for initialized data is specified as:



.data : { __DATA_START = .; (.data) __DATA_END = .; } > ram AT > flash



Which creates the .data section itself, as well as a const section of the same size. Is there some way to name the const part, so I can deside where its placed?



Leo Havmøller.



The placement at run-time is determined by > ram, and the placement of the constant copy is determined by AT > flash.

You can create a new memory section and point to it instead of ram or flash, depending on which you like to place elsewhere.

The constants by GCC are usually in named sections .rodata*.

Tauno Voipio

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required