/** * UNPUBLISHED PROPRIETARY SOURCE CODE * Copyright (c) 2016 MXCHIP Inc. * * The contents of this file may not be disclosed to third parties, copied or * duplicated in any form, in whole or in part, without the prior written * permission of MXCHIP Corporation. * */ Reset_Handler = _start; ENTRY( _start ); /* Include memory map */ INCLUDE memory.ld SECTIONS { .ramcode_copy : { KEEP(*(*.interrupt_vector_table_copy_ramcode)) KEEP(*(.copy_ramcode)) . = ALIGN(512); }>BL_FLASH AT> BL_FLASH .text : { link_run_from_ram_code_flash_location = LOADADDR( .text ); link_run_from_ram_code_ram_location = .; link_interrupt_vectors_location = .; KEEP(*(*.interrupt_vector_table)) KEEP(*(.stub_section)) . = ALIGN(0x4); link_code_location = .; KEEP(*(.text.irq )) *(.text .text.* .gnu.linkonce.t.*) link_code_end = .; . = ALIGN(0x4); link_const_variable_data_location = .; *(.rodata .rodata.* .gnu.linkonce.r.*) link_const_variable_data_end = .; . = ALIGN(0x4); link_constructors_location = .; KEEP(*(.preinit_array)) KEEP(*(.init_array)) KEEP (*crtbegin.o(.ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*crtend.o(.ctors)) link_constructors_end = .; . = ALIGN(0x4); link_destructors_location = .; KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*crtend.o(.dtors)) link_destructors_end = .; . = ALIGN(16); link_run_from_ram_code_ram_end = .; }>SRAM AT> BL_FLASH .data : /* Contains the non-zero initialised global variables */ { link_global_data_initial_values = LOADADDR( .data ); /* This is the location in flash of the initial values of global variables */ link_global_data_start = .; *(.data*) link_global_data_end = .; . = ALIGN(., 4); }> SRAM AT> BL_FLASH .bss : /* Zero initialised memory used for zero initialised variables */ { link_bss_location = ALIGN(., 4); *(.bss*) *(COMMON) link_bss_end = .; . = ALIGN(., 4); }> SRAM AT> SRAM .stack : /* Contains the initial stack */ { link_stack_location = ALIGN(., 4); *(.stack) . = ALIGN(MAX(link_stack_location + __STACKSIZE__ , .), 4); link_stack_end = .; }> SRAM AT> SRAM /DISCARD/ : { /* Usage of Global variables is banned in bootloader */ /* *(.bss*) */ *(COMMON) *(.ARM.attributes*) *(.comment) *(.init) *(.preinit) *(.fini) *(.fini_array) *(.ARM.exidx*) *(.gnu.linkonce.armexidx.*) *(.eh_frame_hdr) *(.eh_frame) *(.gnu.linkonce.armextab.*) *(.v4_bx) *(.vfp11_veneer) *(.gcc_except_table) *(.eh_frame_hdr) *(.eh_frame) *(.glue*) } } /* Declare libc Heap to start at end of allocated RAM */ PROVIDE( _heap = link_stack_end ); /* End of the heap is top of RAM, aligned 8 byte */ PROVIDE( _eheap = ALIGN( ORIGIN( SRAM ) + LENGTH( SRAM ) - 8, 8 ) );