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

@ -196,6 +196,11 @@ SECTIONS {
#include <linker/cplusplus-ram.ld>
#endif /* __MWDT_LINKER_CMD__ */
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
__data_ram_end = .;
MPU_MIN_SIZE_ALIGN
/* Define linker symbols */

View file

@ -298,6 +298,11 @@ SECTIONS
#include <linker/kobject-data.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 = .;

View file

@ -323,6 +323,11 @@ SECTIONS
#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 = .;
#ifndef CONFIG_USERSPACE

View file

@ -274,6 +274,11 @@ SECTIONS
#include <linker/kobject-data.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 = .;

View file

@ -228,6 +228,11 @@ SECTIONS
#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 = .;
SECTION_DATA_PROLOGUE(_BSS_SECTION_NAME,(NOLOAD),)

View file

@ -48,6 +48,11 @@ SECTIONS
#include <arch/posix/native_tasks.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
__data_ram_end = .;
/* Located in generated directory. This file is populated by the

View file

@ -247,6 +247,12 @@ SECTIONS
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-ram-sections.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
__data_ram_end = .;
MPU_MIN_SIZE_ALIGN

View file

@ -104,6 +104,12 @@ SECTIONS
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-ram-sections.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
__data_ram_end = .;
SECTION_DATA_PROLOGUE(_BSS_SECTION_NAME,(NOLOAD),)

View file

@ -476,6 +476,11 @@ SECTIONS
#include <linker/kobject-data.ld>
#endif /* !CONFIG_LINKER_USE_PINNED_SECTION */
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
MMU_PAGE_ALIGN
__data_ram_end = .;

View file

@ -184,6 +184,11 @@ SECTIONS
#include <linker/cplusplus-ram.ld>
#include <arch/x86/pagetables.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-data-sections.ld>
/* Must be last in RAM */
#include <linker/kobject-data.ld>
MMU_PAGE_ALIGN