arches: centralize noinit linker defintiions
This had been copy-pasted between linker scripts, create a central header for it. The linker scripts for xtensa and posix have very different structure and have been left alone. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
1331a83905
commit
59a75dd3a8
9 changed files with 29 additions and 115 deletions
|
@ -167,21 +167,7 @@ SECTIONS {
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),) {
|
#include <linker/common-noinit.ld>
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
*(".kernel_noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) {
|
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) {
|
||||||
|
|
||||||
|
|
|
@ -271,22 +271,7 @@ SECTIONS
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
*(".kernel_noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
||||||
{
|
{
|
||||||
|
|
|
@ -313,22 +313,7 @@ SECTIONS
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
*(".kernel_noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
|
|
|
@ -257,22 +257,7 @@ SECTIONS
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
*(".kernel_noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
||||||
{
|
{
|
||||||
|
|
|
@ -245,21 +245,7 @@ SECTIONS
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
#include <linker/cplusplus-ram.ld>
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
|
|
|
@ -184,21 +184,7 @@ SECTIONS
|
||||||
__bss_end = ALIGN(4);
|
__bss_end = ALIGN(4);
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
|
||||||
|
|
||||||
#include <linker/cplusplus-ram.ld>
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
|
|
|
@ -224,25 +224,10 @@ SECTIONS
|
||||||
|
|
||||||
__bss_num_words = (__bss_end - __bss_start) >> 2;
|
__bss_num_words = (__bss_end - __bss_start) >> 2;
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME, (NOLOAD),)
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This section is used for non-initialized objects that
|
|
||||||
* will not be cleared during the boot process.
|
|
||||||
*/
|
|
||||||
*(.noinit)
|
|
||||||
*(".noinit.*")
|
|
||||||
*(".kernel_noinit.*")
|
|
||||||
|
|
||||||
/* Located in generated directory. This file is populated by the
|
|
||||||
* zephyr_linker_sources() Cmake function.
|
|
||||||
*/
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
|
|
||||||
MMU_PAGE_ALIGN
|
MMU_PAGE_ALIGN
|
||||||
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -153,12 +153,7 @@ SECTIONS
|
||||||
|
|
||||||
__bss_num_dwords = (__bss_end - __bss_start) >> 2;
|
__bss_num_dwords = (__bss_end - __bss_start) >> 2;
|
||||||
|
|
||||||
SECTION_PROLOGUE(_NOINIT_SECTION_NAME, (NOLOAD), ALIGN(16))
|
#include <linker/common-noinit.ld>
|
||||||
{
|
|
||||||
*(.noinit)
|
|
||||||
*(.noinit.*)
|
|
||||||
#include <snippets-noinit.ld>
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
|
||||||
|
|
||||||
#include <snippets-sections.ld>
|
#include <snippets-sections.ld>
|
||||||
|
|
||||||
|
|
21
include/linker/common-noinit.ld
Normal file
21
include/linker/common-noinit.ld
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Intel Corporation.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This section is used for non-initialized objects that
|
||||||
|
* will not be cleared during the boot process.
|
||||||
|
*/
|
||||||
|
*(.noinit)
|
||||||
|
*(".noinit.*")
|
||||||
|
|
||||||
|
/* Located in generated directory. This file is populated by the
|
||||||
|
* zephyr_linker_sources() Cmake function.
|
||||||
|
*/
|
||||||
|
#include <snippets-noinit.ld>
|
||||||
|
|
||||||
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION)
|
Loading…
Add table
Add a link
Reference in a new issue