Files
zTC1/mico-os/platform/MCU/STM32F4xx/GCC/app_ram.ld

176 lines
4.8 KiB
Plaintext

/**
* 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
{
/* Data transfer area for serial flash writing app - at start of memory */
.sflash_trnsf :
{
KEEP(*(*.data_config))
KEEP(*(*.data_transfer))
}>SRAM AT> SRAM
.vectors :
{
. = ALIGN(512);
link_interrupt_vectors_location = .;
KEEP(*(*.interrupt_vector_table))
}>SRAM AT> SRAM
.text :
{
. = ALIGN(4);
link_code_location = .;
KEEP(*(.text.irq ))
*(.text .text.* .gnu.linkonce.t.*)
link_code_end = .;
. = ALIGN(0x4);
link_const_variable_data_location = .;
wifi_firmware_image_location = .;
*(.rodata.wifi_firmware_image)
wifi_firmware_image_end = .;
*(.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);
}>SRAM AT> SRAM
/*
* The .ARM.exidx and .ARM.exidx sections are used for C++ exception handling.
* It is located here for completeness. Bare-metal ARM projects
* typically cannot afford the overhead associated with C++
* exceptions handling.
*/
.ARM.exidx :
{
__exidx_start = ALIGN(4);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} >SRAM AT> SRAM
.ARM.extab :
{
__extab_start = ALIGN(4);
*(.ARM.extab*)
__extab_end = .;
} > SRAM AT> SRAM
.fast : /* This section contains code that is run from RAM after being loaded from flash - functions can be put in this section with the C attribute: __attribute__ ((section (".fast"))) */
{
link_run_from_ram_code_flash_location = LOADADDR( .fast ); /* This is the location in flash of the code */
link_run_from_ram_code_ram_location = .;
*(.fast .fast.* .text.fastcode)
link_run_from_ram_code_ram_end = .;
}>SRAM AT> SRAM
.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> SRAM
.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/ :
{
*(.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 ) );
PROVIDE( total_app_image_size = LOADADDR( .data ) - ORIGIN( SRAM ) + link_global_data_end - link_global_data_start );
PROVIDE( wifi_firmware_image_size_from_link = wifi_firmware_image_end - wifi_firmware_image_location );
/* ThreadX aliases */
PROVIDE( __RAM_segment_used_end__ = link_stack_end );
PROVIDE( __tx_free_memory_start = link_stack_end );
PROVIDE( __tx_vectors = link_interrupt_vectors_location );
PROVIDE( wifi_firmware_image = 0 );