1/*
2 * Copyright (c) 2013-2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/**
8 * @file
9 * @brief Linker command/script file
10 *
11 * Linker script for the Cortex-M platforms.
12 */
13
14#include <zephyr/linker/sections.h>
15#include <zephyr/devicetree.h>
16
17#include <zephyr/linker/linker-defs.h>
18#include <zephyr/linker/linker-tool.h>
19
20/** enable CONFIG_SRAM2 or any other partition in soc Kconfig,
21 * this is just an example to show relocation of code/data/bss script
22 */
23#if defined CONFIG_ARM
24  #define CONFIG_SRAM2 1
25  #define _SRAM2_DATA_SECTION_NAME  .sram2_data
26  #define _SRAM2_BSS_SECTION_NAME   .sram2_bss
27  #define _SRAM2_TEXT_SECTION_NAME  .sram2_text
28  #define SRAM2_ADDR  (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2)
29#endif
30
31#define RAM_SIZE2 (CONFIG_SRAM_SIZE * 512)
32MEMORY
33    {
34#ifdef CONFIG_SRAM2
35    SRAM2                  (wx) : ORIGIN = (CONFIG_SRAM_BASE_ADDRESS + RAM_SIZE2), LENGTH = RAM_SIZE2
36#endif
37    }
38
39/* Include the SoC-specific linker file */
40#include <linker.ld>
41