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

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

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 Havmller.

Re: ld script: named section for const part of .data?
Quoted text here. Click to load it

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

Site Timeline