/* * Copyright (C) 2017-2019 Alibaba Group Holding Limited */ /****************************************************************************** * @file gcc_csky.ld * @brief csky linker file * @version V1.0 * @date 02. June 2017 ******************************************************************************/ MEMORY { SRAM : ORIGIN = 0x00000000 , LENGTH = 0x100000 /* on-chip SRAM 128KB */ } __min_heap_size = 0x200; PROVIDE (__ram_end = 0x00040000 - 0x1000 - 0x8); PROVIDE (__heap_end = __ram_end); REGION_ALIAS("REGION_TEXT", SRAM); REGION_ALIAS("REGION_RODATA", SRAM); REGION_ALIAS("REGION_DATA", SRAM); REGION_ALIAS("REGION_BSS", SRAM); ENTRY(Reset_Handler) SECTIONS { .text : { . = ALIGN(0x4) ; __stext = . ; /* KEEP(*startup.o(*.text*))*/ KEEP(*startup.o) *(.text) *(.text*) *(.text.*) *(.gnu.warning) *(.stub) *(.gnu.linkonce.t*) *(.glue_7t) *(.glue_7) *(.jcr) KEEP (*(.init)) KEEP (*(.fini)) . = ALIGN (4) ; PROVIDE(__ctbp = .); *(.call_table_data) *(.call_table_text) . = ALIGN(0x10) ; __etext = . ; } > REGION_TEXT .eh_frame_hdr : { *(.eh_frame_hdr) } > REGION_TEXT .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > REGION_TEXT .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } > REGION_TEXT .rodata : { . = ALIGN(0x4) ; __srodata = .; *(.rdata) *(.rdata*) *(.rdata1) *(.rdata.*) *(.rodata) *(.rodata1) *(.rodata*) *(.rodata.*) *(.rodata.str1.4) *(.srodata*) . = ALIGN(0x4) ; __ctor_start__ = .; KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) __ctor_end__ = .; KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) __dtor_end__ = .; . = ALIGN(0x4) ; __erodata = .; __rodata_end__ = .; } > REGION_RODATA .data : { . = ALIGN(0x4) ; __sdata = . ; __data_start__ = . ; data_start = . ; /* KEEP(*startup.o(*.vectors*))*/ *(.got.plt) *(.got) *(.gnu.linkonce.r*) *(.data) *(.data*) *(.data1) *(.data.*) *(.gnu.linkonce.d*) *(.data1) *(.gcc_except_table) *(.gcc_except_table*) __start_init_call = .; *(.initcall.init) __stop_init_call = .; __start_cmd = .; *(.bootloaddata.cmd) . = ALIGN(4) ; __stop_cmd = .; __global_pointer$ = .; *(.sdata) *(.sdata.*) *(.sdata2.*) *(.gnu.linkonce.s.*) *(__libc_atexit) *(__libc_subinit) *(__libc_subfreeres) *(.note.ABI-tag) __edata = .; __data_end__ = .; . = ALIGN(0x4) ; } > REGION_DATA .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } > REGION_DATA .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) __edata = .; __data_end__ = .; } > REGION_DATA .bss : { . = ALIGN(0x4) ; __sbss = ALIGN(0x4) ; __bss_start__ = . ; *(.dynsbss) *(.sbss) *(.sbss.*) *(.scommon) *(.dynbss) *(.bss) *(.bss.*) *(COMMON) . = ALIGN(0x4) ; __ebss = . ; __bss_end__ = .; __end = . ; end = . ; } > REGION_BSS ._user_heap : { . = ALIGN(0x8) ; __heap_start = .; . += __min_heap_size; . = ALIGN(0x8) ; } > REGION_BSS }