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


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.

Reply to
Leo Havmøller
Loading thread data ...

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
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.