blob: f7bfbd5a90791674a21845bc9c7f4da3a26369d8 [file] [log] [blame]
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
TCM_LENGTH = DEFINED(__tcm_length__) ? __tcm_length__ : 4M;
MEMORY
{
TCM (rw) : ORIGIN = 0x34000000, LENGTH = TCM_LENGTH
}
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
PROVIDE( _stack_ptr = ORIGIN(TCM) + LENGTH(TCM) - 64 );
PROVIDE( _stack_start_sentinel = ORIGIN(TCM) + LENGTH(TCM) - STACK_SIZE );
PROVIDE( _stack_end_sentinel = ORIGIN(TCM) + LENGTH(TCM) - 64 );
ENTRY(_start)
SECTIONS
{
.text :
{
_stext = .;
KEEP(*(.text._start))
*(.text*)
_etext = .;
} > TCM
.rodata :
{
. = ALIGN(64);
_srodata = .;
*(.rodata*)
_erodata = .;
} > TCM
.preinit_array :
{
PROVIDE(__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE(__preinit_array_end = .);
} > TCM
.init_array :
{
PROVIDE(__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE(__init_array_end = .);
} > TCM
.fini_array :
{
PROVIDE(__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE(__fini_array_end = .);
} > TCM
.model_output :
{
. = ALIGN(64);
_smodel_output = .;
_ret = .;
*(.model_output_header*)
*(.model_output*)
_emodel_output = .;
} > TCM
.data :
{
. = ALIGN(64);
_global_pointer = . + 0x800;
_sdata = .;
*(.data*)
_edata = .;
} > TCM
.bss (NOLOAD) :
{
. = ALIGN(64);
_sbss = .;
*(.bss*)
*(COMMON)
_ebss = .;
} > TCM
.heap (NOLOAD) :
{
. = ALIGN(64);
_sheap = .;
. = ORIGIN(TCM) + LENGTH(TCM) - STACK_SIZE - 63;
. = ALIGN(64);
_eheap = .;
} > TCM
.stack ORIGIN(TCM) + LENGTH(TCM) - STACK_SIZE (NOLOAD) :
{
_sstack = .;
. = . + STACK_SIZE;
. = ALIGN(64);
_estack = .;
} > TCM
_end = .;
}