linker: add an initialized DATA_SECTIONS linker location option

Current location options for linker source files includes init and
noinit ram data, but only a noinit ram section. This makes it impossible
for application code to define an initialized RAM output section,
such as with the Z_ITERABLE_SECTION_RAM() helpers.

Adding a DATA_SECTIONS linker source option for this use case.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2021-08-04 18:21:14 +00:00 committed by Christopher Friedt
commit ef93bbad57
12 changed files with 81 additions and 19 deletions

View file

@ -183,6 +183,11 @@ SECTIONS
#include <linker/common-ram.ld>
#include <linker/cplusplus-ram.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
__data_ram_end = .;
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);