arm, x86, riscv: linker.ld: Move TEXT_SECTION_OFFSET

to its own linker file snippet so snippets can be placed before it.
Using zephyr_linker_sources().

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
Øyvind Rønningstad 2019-11-29 13:31:00 +01:00 committed by Anas Nashif
commit 0b2c8e201c
6 changed files with 13 additions and 7 deletions

View file

@ -33,3 +33,8 @@ zephyr_linker_sources_ifdef(CONFIG_NOCACHE_MEMORY
RAM_SECTIONS RAM_SECTIONS
nocache.ld nocache.ld
) )
# Only ARM, X86 and RISCV use TEXT_SECTION_OFFSET
if (DEFINED CONFIG_ARM OR DEFINED CONFIG_X86 OR DEFINED CONFIG_RISCV)
zephyr_linker_sources(TEXT_START SORT_KEY 0x0 text_section_offset.ld)
endif()

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
. = CONFIG_TEXT_SECTION_OFFSET;
. = ALIGN(4);

View file

@ -138,8 +138,6 @@ SECTIONS
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{ {
. = CONFIG_TEXT_SECTION_OFFSET;
/* Located in generated directory. This file is populated by the /* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function. * zephyr_linker_sources() Cmake function.
*/ */

View file

@ -134,7 +134,6 @@ SECTIONS
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{ {
. = CONFIG_TEXT_SECTION_OFFSET;
/* Located in generated directory. This file is populated by the /* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function. * zephyr_linker_sources() Cmake function.

View file

@ -85,7 +85,6 @@ SECTIONS
_image_text_start = PHYS_LOAD_ADDR; _image_text_start = PHYS_LOAD_ADDR;
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{ {
. = CONFIG_TEXT_SECTION_OFFSET;
/* Located in generated directory. This file is populated by the /* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function. * zephyr_linker_sources() Cmake function.

View file

@ -103,9 +103,6 @@ SECTIONS
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{ {
. = CONFIG_TEXT_SECTION_OFFSET;
. = ALIGN(4);
/* /*
* Respect for CONFIG_TEXT_SECTION_OFFSET is mandatory * Respect for CONFIG_TEXT_SECTION_OFFSET is mandatory
* for MCUboot support, so .reset.* and .exception.* * for MCUboot support, so .reset.* and .exception.*