diff --git a/sw/linker/link_flash_load.ld.tpl.backup b/sw/linker/link_flash_load.ld.tpl.backup deleted file mode 100644 index 87b03684c..000000000 --- a/sw/linker/link_flash_load.ld.tpl.backup +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright EPFL contributors. - * Licensed under the Apache License, Version 2.0, see LICENSE for details. - * SPDX-License-Identifier: Apache-2.0 - */ - -ENTRY(_start) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x${flash_mem_start_address}, LENGTH = 0x${flash_mem_size_address} - ram0 (rwxai) : ORIGIN = 0x${linker_onchip_code_start_address}, LENGTH = 0x${linker_onchip_code_size_address} - ram1 (rwxai) : ORIGIN = 0x${linker_onchip_data_start_address}, LENGTH = 0x${linker_onchip_data_size_address} - % if ram_numbanks_cont > 1 and ram_numbanks_il > 0: - ram_il (rwxai) : ORIGIN = 0x${linker_onchip_il_start_address}, LENGTH = 0x${linker_onchip_il_size_address} - % endif -} - -SECTIONS { - - /* we want a fixed entry point */ - PROVIDE(__boot_address = 0x180); - - /* stack and heap related settings */ - __stack_size = DEFINED(__stack_size) ? __stack_size : 0x800; - PROVIDE(__stack_size = __stack_size); - __heap_size = DEFINED(__heap_size) ? __heap_size : 0x800; - - /* Read-only sections, merged into text segment: */ - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000)); . = SEGMENT_START("text-segment", 0x10000) + SIZEOF_HEADERS; - - /* interrupt vectors */ - .vectors (ORIGIN(ram0)): - { - PROVIDE(__vector_start = .); - KEEP(*(.vectors)); - __VECTORS_AT = .; - } >ram0 AT >FLASH - - /* Fill memory up to __boot_address */ - .fill : - { - FILL(0xDEADBEEF); - . = ORIGIN(ram0) + (__boot_address) - 1; - BYTE(0xEE) - } >ram0 AT >FLASH - - /* crt0 init code */ - .init (__boot_address): - { - KEEP (*(SORT_NONE(.init))) - KEEP (*(.text.start)) - } >ram0 AT >FLASH - - /* The program code and other data goes into FLASH */ - .text : ALIGN_WITH_INPUT - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } >ram0 AT >FLASH - - /* not used by RISC-V*/ - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } >ram0 AT >FLASH - - /* gcc language agnostic exception related sections (try-catch-finally) */ - .eh_frame_hdr : - { - *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) - } >ram0 AT >FLASH - .eh_frame : ONLY_IF_RO - { - KEEP (*(.eh_frame)) *(.eh_frame.*) - } >ram0 AT >FLASH - .gcc_except_table : ONLY_IF_RO - { - *(.gcc_except_table .gcc_except_table.*) - } >ram0 AT >FLASH - .gnu_extab : ONLY_IF_RO - { - *(.gnu_extab*) - } >ram0 AT >FLASH - - /* These sections are generated by the Sun/Oracle C++ compiler. */ - /* - .exception_ranges : ONLY_IF_RO { *(.exception_ranges - .exception_ranges*) } - */ - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. */ - . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); - - /* Exception handling */ - .eh_frame : ONLY_IF_RW - { - KEEP (*(.eh_frame)) *(.eh_frame.*) - } >ram0 AT >FLASH - .gnu_extab : ONLY_IF_RW - { - *(.gnu_extab) - } >ram0 AT >FLASH - .gcc_except_table : ONLY_IF_RW - { - *(.gcc_except_table .gcc_except_table.*) - } >ram0 AT >FLASH - .exception_ranges : ONLY_IF_RW - { - *(.exception_ranges .exception_ranges*) - } >ram0 AT >FLASH - - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } >ram0 AT >FLASH - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } >ram0 AT >FLASH - - . = ALIGN(4); - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - - /* read-only sections */ - .rodata : ALIGN_WITH_INPUT - { - *(.rodata .rodata.* .gnu.linkonce.r.*) - } >ram1 AT >FLASH - - .rodata1 : ALIGN_WITH_INPUT - { - *(.rodata1) - } >ram1 AT >FLASH - - - .data : ALIGN_WITH_INPUT - { - . = ALIGN(4); - _sidata = LOADADDR(.data); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - _ram_start = .; /* create a global symbol at ram start for garbage collector */ - . = ALIGN(4); - __DATA_BEGIN__ = .; - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - __SDATA_BEGIN__ = .; - *(.sdata) /* .sdata sections */ - *(.sdata*) /* .sdata* sections */ - } >ram1 AT >FLASH - - .data1 : - { - *(.data1) - } >ram1 AT >FLASH - - /* Thread Local Storage sections */ - .tdata : - { - PROVIDE_HIDDEN (__tdata_start = .); - *(.tdata .tdata.* .gnu.linkonce.td.*) - } >ram1 AT >FLASH - - .tbss : - { - *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) - } >ram1 AT >FLASH - - /* initialization and termination routines */ - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram1 AT >FLASH - - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } >ram1 AT >FLASH - - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >ram1 AT >FLASH - - - .power_manager : ALIGN(4096) - { - PROVIDE(__power_manager_start = .); - . += 256; - } >ram1 AT >FLASH - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - __bss_start = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(.sbss) - *(.sbss*) - *(COMMON) - - . = ALIGN(4); - __bss_end = .; /* define a global symbol at bss end; used by startup code */ - __BSS_END__ = .; - } >ram1 AT >FLASH - - /* The compiler uses this to access data in the .sdata, .data, .sbss and .bss - sections with fewer instructions (relaxation). This reduces code size. */ - __global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800, - MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800)); - _end = .; PROVIDE (end = .); - . = DATA_SEGMENT_END (.); - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - PROVIDE(__heap_start = .); - . = __heap_size; - PROVIDE(__heap_end = .); - } >ram1 AT >FLASH - - /* stack: we should consider putting this further to the top of the address - space */ - .stack : ALIGN(16) /* this is a requirement of the ABI(?) */ - { - PROVIDE(__stack_start = .); - . = __stack_size; - PROVIDE(_sp = .); - PROVIDE(__stack_end = .); - PROVIDE(__freertos_irq_stack_top = .); - } >ram1 AT >FLASH - -% if ram_numbanks_cont > 1 and ram_numbanks_il > 0: - .data_interleaved : ALIGN_WITH_INPUT - { - PROVIDE(__data_interleaved_start = .); - } >ram_il AT >FLASH -% endif - - . = ALIGN(4); - _edata_interleaved = .; - -}