GROUP ( "libgcc.a" "libc_nano.a" "libm.a" "libcr_newlib_semihost.a" ) MEMORY { /* Define each memory region. */ PROGRAM_FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0xfe00 /* 63.5K bytes (alias Flash). */ SG_veneer_table (rx): ORIGIN = 0x1000fe00, LENGTH = 0x200 /* 0.5K bytes (alias Flash2). */ Ram0 (rwx) : ORIGIN = 0x30000000, LENGTH = 0x8000 /* 32K bytes (alias RAM). */ } /* Define a symbol for the top of each memory region. */ __base_PROGRAM_FLASH = 0x10000000; /* PROGRAM_FLASH. */ __base_Flash = 0x10000000; /* Flash. */ __top_PROGRAM_FLASH = 0x10000000 + 0xfe00; /* 63.5K bytes */ __top_Flash = 0x10000000 + 0xfe00; /* 63.5K bytes */ __base_SG_veneer_table = 0x1000fe00; /* SG_veneer_table. */ __base_Flash2 = 0x1000fe00; /* Flash2. */ __top_SG_veneer_table = 0x1000fe00 + 0x200; /* 0.5K bytes. */ __top_Flash2 = 0x1000fe00 + 0x200; /* 0.5K bytes. */ __base_Ram0 = 0x30000000; /* Ram0. */ __base_RAM = 0x30000000; /* RAM. */ __top_Ram0 = 0x30000000 + 0x8000; /* 32K bytes. */ __top_RAM = 0x30000000 + 0x8000; /* 32K bytes. */ /* Entry point. */ ENTRY(ResetISR) SECTIONS { /* Place TrustZone Secure Gateway Stubs Section in SG_veneer_table' * (Non-Secure Callable) memory. */ .gnu.sgstubs : ALIGN (32) { . = ALIGN(32); _start_sg = .; *(.gnu.sgstubs*) . = ALIGN(32); _end_sg = .; } > SG_veneer_table /* Veneer Table Section (Non-Secure Callable). */ .text_Flash2 : ALIGN(4) { FILL(0xff) *(.text_Flash2) /* For compatibility with previous releases. */ *(.text_SG_veneer_table) /* For compatibility with previous releases. */ *(.text.$Flash2) *(.text.$SG_veneer_table) *(.text_Flash2.*) /* For compatibility with previous releases. */ *(.text_SG_veneer_table.*) /* For compatibility with previous releases. */ *(.text.$Flash2.*) *(.text.$SG_veneer_table.*) *(.rodata.$Flash2) *(.rodata.$SG_veneer_table) *(.rodata.$Flash2.*) *(.rodata.$SG_veneer_table.*) } > SG_veneer_table /* Vector Table Section. */ .text : ALIGN(4) { FILL(0xff) __vectors_start__ = ABSOLUTE(.); KEEP(*(.isr_vector)) /* Global Section Table. */ . = ALIGN(4); __section_table_start = .; __data_section_table = .; LONG(LOADADDR(.data)); LONG( ADDR(.data)); LONG( SIZEOF(.data)); __data_section_table_end = .; __bss_section_table = .; LONG( ADDR(.bss)); LONG( SIZEOF(.bss)); __bss_section_table_end = .; __section_table_end = .; /* End of Global Section Table. */ *(.after_vectors*) } > PROGRAM_FLASH /* Main Text Section. */ .text : ALIGN(4) { *(.text*) *(.rodata .rodata.* .constdata .constdata.*) . = ALIGN(4); } > PROGRAM_FLASH /* For exception handling/unwind - some Newlib functions (in common * with C++ and STDC++) use this. */ .ARM.extab : ALIGN(4) { *(.ARM.extab* .gnu.linkonce.armextab.*) } > PROGRAM_FLASH .ARM.exidx : ALIGN(4) { __exidx_start = .; *(.ARM.exidx* .gnu.linkonce.armexidx.*) __exidx_end = .; } > PROGRAM_FLASH /* Text Section End. */ _etext = .; /* Uninit Reserved Section. */ .uninit_RESERVED : ALIGN(4) { _start_uninit_RESERVED = .; KEEP(*(.bss.$RESERVED*)) . = ALIGN(4); _end_uninit_RESERVED = .; } > Ram0 AT>Ram0 /* Main Data section (Ram0). */ .data : ALIGN(4) { FILL(0xff) _data = .; PROVIDE(__start_data_RAM = .); PROVIDE(__start_data_Ram0 = .); *(vtable) *(.ramfunc*) *(.data*) . = ALIGN(4); _edata = .; PROVIDE(__end_data_RAM = .); PROVIDE(__end_data_Ram0 = .); } > Ram0 AT>PROGRAM_FLASH /* Main BSS Section. */ .bss : ALIGN(4) { _bss = .; PROVIDE(__start_bss_RAM = .); PROVIDE(__start_bss_Ram0 = .); *(.bss*) *(COMMON) . = ALIGN(4); _ebss = .; PROVIDE(__end_bss_RAM = .); PROVIDE(__end_bss_Ram0 = .); PROVIDE(end = .); } > Ram0 AT>Ram0 /* Default Noinit Section. */ .noinit (NOLOAD) : ALIGN(4) { _noinit = .; PROVIDE(__start_noinit_RAM = .); PROVIDE(__start_noinit_Ram0 = .); *(.noinit*) . = ALIGN(4); _end_noinit = .; PROVIDE(__end_noinit_RAM = .); PROVIDE(__end_noinit_Ram0 = .); } > Ram0 AT>Ram0 /* Reserve space and place heap in memory map. */ _HeapSize = 0x800; .heap : ALIGN(4) { _pvHeapStart = .; . += _HeapSize; . = ALIGN(4); _pvHeapLimit = .; } > Ram0 /* Reserve space for stack in memory. */ _StackSize = 0x800; .heap2stackfill : { . += _StackSize; } > Ram0 /* Place actual stack in memory map. */ .stack ORIGIN(Ram0) + LENGTH(Ram0) - _StackSize - 0 : ALIGN(4) { _vStackBase = .; . = ALIGN(4); _vStackTop = . + _StackSize; } > Ram0 /* Create checksum value (used in startup). */ PROVIDE(__valid_user_code_checksum = 0 - (_vStackTop + (ResetISR + 1) + (NMI_Handler + 1) + (HardFault_Handler + 1) + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined. */ + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined. */ + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined. */ ) ); /* Provide basic symbols giving location and size of main text block, * including initial values of RW data sections. Note that these will need * extending to give a complete picture with complex images * (e.g multiple Flash banks). */ _image_start = LOADADDR(.text); _image_end = LOADADDR(.data) + SIZEOF(.data); _image_size = _image_end - _image_start; }