2022-09-06 12:48:16 +08:00
|
|
|
/*
|
2023-08-15 18:41:20 +08:00
|
|
|
* Copyright 2021-2023 HPMicro
|
2022-09-06 12:48:16 +08:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
ENTRY(_start)
|
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
STACK_SIZE = DEFINED(_stack_size) ? _stack_size : 0x2000;
|
|
|
|
HEAP_SIZE = DEFINED(_heap_size) ? _heap_size : 0x8000;
|
|
|
|
NONCACHEABLE_SIZE = DEFINED(_noncacheable_size) ? _noncacheable_size : 0x10000;
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
2023-08-15 18:41:20 +08:00
|
|
|
ILM (wx) : ORIGIN = 0, LENGTH = 128K
|
|
|
|
DLM (w) : ORIGIN = 0x80000, LENGTH = 96K
|
|
|
|
NONCACHEABLE_RAM (wx) : ORIGIN = 0x90000, LENGTH = NONCACHEABLE_SIZE
|
|
|
|
AXI_SRAM (wx) : ORIGIN = 0x01084000, LENGTH = 224K
|
|
|
|
SHARE_RAM (w) : ORIGIN = 0x010BC000, LENGTH = 16K
|
|
|
|
AHB_SRAM (w) : ORIGIN = 0xF0300000, LENGTH = 32k
|
2022-09-06 12:48:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
2023-08-15 18:41:20 +08:00
|
|
|
.start : {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
KEEP(*(.start))
|
2023-08-15 18:41:20 +08:00
|
|
|
} > ILM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.vectors : {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
KEEP(*(.isr_vector))
|
2023-08-15 18:41:20 +08:00
|
|
|
KEEP(*(.vector_table))
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
2023-08-15 18:41:20 +08:00
|
|
|
} > ILM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.text : {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
*(.text)
|
|
|
|
*(.text*)
|
|
|
|
*(.rodata)
|
|
|
|
*(.rodata*)
|
|
|
|
*(.srodata)
|
|
|
|
*(.srodata*)
|
|
|
|
|
|
|
|
*(.hash)
|
|
|
|
*(.dyn*)
|
|
|
|
*(.gnu*)
|
|
|
|
*(.pl*)
|
2023-08-15 18:41:20 +08:00
|
|
|
*(FalPartTable)
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
KEEP(*(.eh_frame))
|
|
|
|
*(.eh_frame*)
|
|
|
|
|
|
|
|
KEEP (*(.init))
|
|
|
|
KEEP (*(.fini))
|
|
|
|
. = ALIGN(8);
|
|
|
|
|
|
|
|
/*********************************************
|
|
|
|
*
|
|
|
|
* RT-Thread related sections - Start
|
|
|
|
*
|
|
|
|
*********************************************/
|
|
|
|
/* section information for finsh shell */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__fsymtab_start = .;
|
|
|
|
KEEP(*(FSymTab))
|
|
|
|
__fsymtab_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
__vsymtab_start = .;
|
|
|
|
KEEP(*(VSymTab))
|
|
|
|
__vsymtab_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rt_init_start = .;
|
|
|
|
KEEP(*(SORT(.rti_fn*)))
|
|
|
|
__rt_init_end = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
/* section information for modules */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rtmsymtab_start = .;
|
|
|
|
KEEP(*(RTMSymTab))
|
|
|
|
__rtmsymtab_end = .;
|
|
|
|
|
|
|
|
/* RT-Thread related sections - end */
|
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
PROVIDE (__etext = .);
|
|
|
|
PROVIDE (_etext = .);
|
|
|
|
PROVIDE (etext = .);
|
|
|
|
} > AXI_SRAM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
.rel : {
|
|
|
|
KEEP(*(.rel*))
|
2023-08-15 18:41:20 +08:00
|
|
|
} > AXI_SRAM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.fast_ram (NOLOAD) : {
|
|
|
|
KEEP(*(.fast_ram))
|
|
|
|
} > DLM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.bss(NOLOAD) : {
|
|
|
|
. = ALIGN(8);
|
|
|
|
__bss_start__ = .;
|
|
|
|
*(.bss)
|
|
|
|
*(.bss*)
|
|
|
|
*(.sbss*)
|
|
|
|
*(.scommon)
|
|
|
|
*(.scommon*)
|
|
|
|
*(.dynsbss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(8);
|
|
|
|
_end = .;
|
|
|
|
__bss_end__ = .;
|
|
|
|
} > DLM
|
|
|
|
|
|
|
|
/* Note: .tbss and .tdata should be adjacent */
|
|
|
|
.tbss(NOLOAD) : {
|
|
|
|
. = ALIGN(8);
|
|
|
|
__tbss_start__ = .;
|
|
|
|
*(.tbss*)
|
|
|
|
*(.tcommon*)
|
|
|
|
_end = .;
|
|
|
|
__tbss_end__ = .;
|
|
|
|
} > DLM
|
|
|
|
|
|
|
|
.tdata : AT(etext) {
|
|
|
|
. = ALIGN(8);
|
|
|
|
__tdata_start__ = .;
|
|
|
|
__thread_pointer = .;
|
|
|
|
*(.tdata)
|
|
|
|
*(.tdata*)
|
|
|
|
. = ALIGN(8);
|
|
|
|
__tdata_end__ = .;
|
|
|
|
} > DLM
|
|
|
|
|
|
|
|
.data : AT(etext + __tdata_end__ - __tdata_start__) {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
__data_start__ = .;
|
|
|
|
__global_pointer$ = . + 0x800;
|
|
|
|
*(.data)
|
|
|
|
*(.data*)
|
|
|
|
*(.sdata)
|
|
|
|
*(.sdata*)
|
|
|
|
|
|
|
|
KEEP(*(.jcr))
|
|
|
|
KEEP(*(.dynamic))
|
|
|
|
KEEP(*(.got*))
|
|
|
|
KEEP(*(.got))
|
|
|
|
KEEP(*(.gcc_except_table))
|
|
|
|
KEEP(*(.gcc_except_table.*))
|
|
|
|
|
|
|
|
. = ALIGN(8);
|
|
|
|
PROVIDE(__preinit_array_start = .);
|
|
|
|
KEEP(*(.preinit_array))
|
|
|
|
PROVIDE(__preinit_array_end = .);
|
|
|
|
|
|
|
|
. = ALIGN(8);
|
|
|
|
PROVIDE(__init_array_start = .);
|
|
|
|
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
|
|
|
KEEP(*(.init_array))
|
|
|
|
PROVIDE(__init_array_end = .);
|
|
|
|
|
|
|
|
. = ALIGN(8);
|
|
|
|
PROVIDE(__finit_array_start = .);
|
|
|
|
KEEP(*(SORT_BY_INIT_PRIORITY(.finit_array.*)))
|
|
|
|
KEEP(*(.finit_array))
|
|
|
|
PROVIDE(__finit_array_end = .);
|
|
|
|
|
|
|
|
. = ALIGN(8);
|
2023-08-15 18:41:20 +08:00
|
|
|
PROVIDE(__ctors_start__ = .);
|
2022-09-06 12:48:16 +08:00
|
|
|
KEEP(*crtbegin*.o(.ctors))
|
|
|
|
KEEP(*(EXCLUDE_FILE (*crtend*.o) .ctors))
|
|
|
|
KEEP(*(SORT(.ctors.*)))
|
|
|
|
KEEP(*(.ctors))
|
2023-08-15 18:41:20 +08:00
|
|
|
PROVIDE(__ctors_end__ = .);
|
2022-09-06 12:48:16 +08:00
|
|
|
|
|
|
|
. = ALIGN(8);
|
|
|
|
KEEP(*crtbegin*.o(.dtors))
|
|
|
|
KEEP(*(EXCLUDE_FILE (*crtend*.o) .dtors))
|
|
|
|
KEEP(*(SORT(.dtors.*)))
|
|
|
|
KEEP(*(.dtors))
|
2023-08-15 18:41:20 +08:00
|
|
|
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
__data_end__ = .;
|
|
|
|
PROVIDE (__edata = .);
|
|
|
|
PROVIDE (_edata = .);
|
|
|
|
PROVIDE (edata = .);
|
2023-08-15 18:41:20 +08:00
|
|
|
} > DLM
|
|
|
|
|
|
|
|
.fast : AT(etext + __data_end__ - __tdata_start__) {
|
|
|
|
. = ALIGN(8);
|
|
|
|
PROVIDE(__ramfunc_start__ = .);
|
|
|
|
*(.fast)
|
|
|
|
. = ALIGN(8);
|
|
|
|
PROVIDE(__ramfunc_end__ = .);
|
|
|
|
} > ILM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.noncacheable.init : AT(etext + __data_end__ - __tdata_start__ + __ramfunc_end__ - __ramfunc_start__) {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
__noncacheable_init_start__ = .;
|
|
|
|
KEEP(*(.noncacheable.init))
|
|
|
|
__noncacheable_init_end__ = .;
|
2023-08-15 18:41:20 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
} > NONCACHEABLE_RAM
|
|
|
|
|
|
|
|
.sh_mem (NOLOAD) : {
|
|
|
|
KEEP(*(.sh_mem))
|
|
|
|
} > SHARE_RAM
|
|
|
|
__share_mem_start__ = ORIGIN(SHARE_RAM);
|
|
|
|
__share_mem_end__ = ORIGIN(SHARE_RAM) + LENGTH(SHARE_RAM);
|
|
|
|
|
|
|
|
.noncacheable.bss (NOLOAD) : {
|
|
|
|
. = ALIGN(8);
|
2022-09-06 12:48:16 +08:00
|
|
|
KEEP(*(.noncacheable))
|
|
|
|
__noncacheable_bss_start__ = .;
|
|
|
|
KEEP(*(.noncacheable.bss))
|
|
|
|
__noncacheable_bss_end__ = .;
|
|
|
|
. = ALIGN(8);
|
2023-08-15 18:41:20 +08:00
|
|
|
} > NONCACHEABLE_RAM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
__noncacheable_start__ = ORIGIN(NONCACHEABLE_RAM);
|
|
|
|
__noncacheable_end__ = ORIGIN(NONCACHEABLE_RAM) + LENGTH(NONCACHEABLE_RAM);
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.ahb_sram (NOLOAD) : {
|
|
|
|
KEEP(*(.ahb_sram))
|
|
|
|
} > AHB_SRAM
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
.stack(NOLOAD) : {
|
2022-09-06 12:48:16 +08:00
|
|
|
. = ALIGN(8);
|
|
|
|
__stack_base__ = .;
|
|
|
|
. += STACK_SIZE;
|
|
|
|
PROVIDE (_stack = .);
|
|
|
|
PROVIDE (_stack_in_dlm = .);
|
2023-08-15 18:41:20 +08:00
|
|
|
PROVIDE (__rt_rvstack = .);
|
|
|
|
} > DLM
|
|
|
|
|
|
|
|
.heap (NOLOAD) : {
|
|
|
|
. = ALIGN(8);
|
|
|
|
__heap_start__ = .;
|
|
|
|
. += HEAP_SIZE;
|
|
|
|
__heap_end__ = .;
|
2022-09-06 12:48:16 +08:00
|
|
|
|
2023-08-15 18:41:20 +08:00
|
|
|
} > DLM
|
2022-09-06 12:48:16 +08:00
|
|
|
}
|