zephyr/arch/common/CMakeLists.txt
Øyvind Rønningstad 05f0d85b6a 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>
2020-01-23 03:22:59 -08:00

42 lines
966 B
CMake

# SPDX-License-Identifier: Apache-2.0
if(CONFIG_GEN_ISR_TABLES OR CONFIG_EXECUTION_BENCHMARKING)
zephyr_library()
zephyr_library_sources_ifdef(
CONFIG_GEN_ISR_TABLES
isr_tables.c
sw_isr_common.c
)
zephyr_library_sources_ifdef(
CONFIG_EXECUTION_BENCHMARKING
timing_info_bench.c
)
endif()
# Put functions and data in their own binary sections so that ld can
# garbage collect them
zephyr_cc_option(-ffunction-sections -fdata-sections)
zephyr_linker_sources_ifdef(CONFIG_GEN_ISR_TABLES
SECTIONS
isr_tables.ld
)
zephyr_linker_sources_ifdef(CONFIG_ARCH_HAS_RAMFUNC_SUPPORT
RAM_SECTIONS
ramfunc.ld
)
zephyr_linker_sources_ifdef(CONFIG_NOCACHE_MEMORY
RAM_SECTIONS
nocache.ld
)
# Only ARM, X86 and OPENISA_RV32M1_RISCV32 use TEXT_SECTION_OFFSET.
if (DEFINED CONFIG_ARM OR DEFINED CONFIG_X86
OR DEFINED CONFIG_SOC_OPENISA_RV32M1_RISCV32)
zephyr_linker_sources(ROM_START SORT_KEY 0x0 text_section_offset.ld)
endif()