mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-10-01 01:45:38 -04:00
d77654bb8e
We don't use any .data or .bss segment at all to keep all the firmware variables in the stack in protected fw_ram. Signed-off-by: Daniel Lublin <daniel@lublin.se>
73 lines
1.4 KiB
Plaintext
73 lines
1.4 KiB
Plaintext
/*
|
|
* Copyright (C) 2022 - Tillitis AB
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
*/
|
|
|
|
OUTPUT_ARCH( "riscv" )
|
|
ENTRY(_start)
|
|
|
|
MEMORY
|
|
{
|
|
/* TODO ROM size should be adjusted, RAM should be ok. */
|
|
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x20000 /* 128 KB */
|
|
RAM (rwx) : ORIGIN = 0x40000000, LENGTH = 0x20000 /* 128 KB */
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
.text.init :
|
|
{
|
|
*(.text.init)
|
|
} >ROM
|
|
|
|
.htif :
|
|
{
|
|
. = ALIGN(0x00000000);
|
|
*(.htif)
|
|
} >ROM
|
|
|
|
.text :
|
|
{
|
|
. = ALIGN(4);
|
|
*(.text) /* .text sections (code) */
|
|
*(.text*) /* .text* sections (code) */
|
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
|
*(.srodata) /* .rodata sections (constants, strings, etc.) */
|
|
*(.srodata*) /* .rodata* sections (constants, strings, etc.) */
|
|
. = ALIGN(4);
|
|
_etext = .;
|
|
_sidata = _etext;
|
|
} >ROM
|
|
|
|
/* XXX We don't allow any data or BSS - but they need be defined or linking will fail */
|
|
|
|
.data : AT (_etext)
|
|
{
|
|
. = ALIGN(4);
|
|
_sdata = .;
|
|
. = ALIGN(4);
|
|
*(.data) /* .data sections */
|
|
*(.data*) /* .data* sections */
|
|
*(.sdata) /* .sdata sections */
|
|
*(.sdata*) /* .sdata* sections */
|
|
. = ALIGN(4);
|
|
_edata = .;
|
|
} >ROM
|
|
|
|
/* Uninitialized data section */
|
|
.bss :
|
|
{
|
|
. = ALIGN(4);
|
|
_sbss = .;
|
|
*(.bss)
|
|
*(.bss*)
|
|
*(.sbss)
|
|
*(.sbss*)
|
|
*(COMMON)
|
|
|
|
. = ALIGN(4);
|
|
_ebss = .;
|
|
} >ROM
|
|
}
|