1/* target.ld
2 *
3 * Copyright (C) 2006-2020 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL. (formerly known as CyaSSL)
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22/* IoT-safe example
23 * Linker script for STM32L4
24 */
25
26
27MEMORY
28{
29    FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1M
30    SRAM1_STACK (rw) : ORIGIN = 0x20000000, LENGTH = 16K
31    SRAM1(rw) : ORIGIN = 0x20000000 + 16K, LENGTH = 256K - 16K
32    SRAM2 (rw) : ORIGIN = 0x20040000, LENGTH = 64K
33}
34
35SECTIONS
36{
37    .text :
38    {
39        _start_text = .;
40        KEEP(*(.isr_vector))
41        *(.text*)
42        *(.rodata*)
43        . = ALIGN(4);
44        _end_text = .;
45    } > FLASH
46
47    .edidx :
48    {
49        . = ALIGN(4);
50        *(.ARM.exidx*)
51    } > FLASH
52
53    _stored_data = .;
54
55    .data : AT (_stored_data)
56    {
57        _start_data = .;
58        *(.data*)
59        . = ALIGN(4);
60        _end_data = .;
61    } > SRAM1
62
63    .bss :
64    {
65        _start_bss = .;
66        *(.bss*)
67        *(COMMON)
68        . = ALIGN(4);
69        _end_bss = .;
70        _end = .;
71    } > SRAM1
72
73}
74
75PROVIDE(_start_heap = ORIGIN(SRAM2));
76PROVIDE(_end_stack  = ORIGIN(SRAM1_STACK) + LENGTH(SRAM1_STACK));
77