extensions.cmake: Replace TEXT_START with ROM_START

In zephyr_linker_sources().
This is done since the point of the location is to place things at given
offsets. This can only be done consistenly if the linker code is placed
into the _first_ section.

All uses of TEXT_START are replaced with ROM_START.

ROM_START is only supported in some arches, as some arches have several
custom sections before text. These don't currently have ROM_START or
TEXT_START available, but that could be added with a bit of refactoring
in their linker script.

No SORT_KEYs are changed.

This also fixes an error introduced when TEXT_START was added, where
TEXT_SECTION_OFFSET was applied to riscv's common linker.ld instead of
to openisa_rv32m1's specific linker.ld.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
Øyvind Rønningstad 2020-01-17 14:36:19 +01:00 committed by Andrew Boie
commit 05f0d85b6a
16 changed files with 39 additions and 42 deletions

View file

@ -87,10 +87,11 @@ SECTIONS {
_image_rom_start = .;
_image_text_start = .;
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
/* Located in generated directory. This file is populated by calling
* zephyr_linker_sources(ROM_START ...). This typically contains the vector
* table and debug information.
*/
#include <snippets-text-start.ld>
#include <snippets-rom-start.ld>
*(.text)
*(".text.*")

View file

@ -138,10 +138,11 @@ SECTIONS
SECTION_PROLOGUE(rom_start,,)
{
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
/* Located in generated directory. This file is populated by calling
* zephyr_linker_sources(ROM_START ...). This typically contains the vector
* table and debug information.
*/
#include <snippets-text-start.ld>
#include <snippets-rom-start.ld>
} GROUP_LINK_IN(ROMABLE_REGION)

View file

@ -135,10 +135,11 @@ SECTIONS
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
/* Located in generated directory. This file is populated by calling
* zephyr_linker_sources(ROM_START ...). This typically contains the vector
* table and debug information.
*/
#include <snippets-text-start.ld>
#include <snippets-rom-start.ld>
} GROUP_LINK_IN(ROMABLE_REGION)

View file

@ -121,11 +121,6 @@ SECTIONS
_image_text_start = .;
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-text-start.ld>
*(.text)
*(".text.*")
*(.gnu.linkonce.t.*)

View file

@ -89,11 +89,6 @@ SECTIONS
_image_text_start = .;
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
*/
#include <snippets-text-start.ld>
*(.text)
*(".text.*")
*(.gnu.linkonce.t.*)

View file

@ -86,10 +86,11 @@ SECTIONS
SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.
/* Located in generated directory. This file is populated by calling
* zephyr_linker_sources(ROM_START ...). This typically contains the vector
* table and debug information.
*/
#include <snippets-text-start.ld>
#include <snippets-rom-start.ld>
*(.text_start)
*(".text_start.*")