/
sunnf
/
morse_code
Обзор
Документация
Войти
/
sunnf
/
morse_code
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
src/link.ld
179 строк
6 KB
sunfmoon
Initial commit: added Morse code simulator for STM32F411
21 май 2026, 13:20
21 май 2026, 13:20
dd58322
Код
Авторство
О чём код?
/***************************************************************************** * * * Copyright (C) 2023 AdaCore * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * * ware Foundation; either version 3, or (at your option) any later ver- * * sion. GNAT is distributed in the hope that it will be useful, but WITH- * * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * * or FITNESS FOR A PARTICULAR PURPOSE. * * * * As a special exception under Section 7 of GPL version 3, you are granted * * additional permissions described in the GCC Runtime Library Exception, * * version 3.1, as published by the Free Software Foundation. * * * * You should have received a copy of the GNU General Public License and * * a copy of the GCC Runtime Library Exception along with this program; * * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see * * <http://www.gnu.org/licenses/>. * * * *****************************************************************************/ /* This is a ARM specific version of this file */ /* This script replaces ld's default linker script, providing the appropriate memory map and output format. */ SEARCH_DIR(.) __DYNAMIC = 0; _DEFAULT_STACK_SIZE = 0x1000; ENTRY(Reset_Handler); MEMORY { FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 0x80000 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 } /* * Boot memory (.text, .ro_data, interrupt vector): FLASH * Main RAM memory (.data, .bss, stacks, interrupt stacks): FLASH */ SECTIONS { /*********/ /* FLASH */ /*********/ .text : { KEEP (*(.vectors)) *(.text .text.* .gnu.linkonce.t*) *(.gnu.warning) KEEP (*(.init)) KEEP (*(.fini)) } > FLASH .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > FLASH /* .ARM.exidx is 4-bytes aligned, so __exidx_start needs to be aligned too. Note that assigning the location counter also makes ld attach the following symbols to the next section (instead of the previous section which is the default), so will properly consider the location counter of .ARM.exidx for __exidx_start and __exidx_end and not the previous section's one. */ . = ALIGN(0x4); PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > FLASH PROVIDE_HIDDEN (__exidx_end = .); .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array*)) PROVIDE_HIDDEN (__preinit_array_end = .); } > FLASH .init_array : { PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array*)) PROVIDE_HIDDEN (__init_array_end = .); } > FLASH .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); KEEP (*(SORT(.fini_array.*))) KEEP (*(.fini_array*)) PROVIDE_HIDDEN (__fini_array_end = .); } > FLASH .rodata : { *(.lit) *(.rodata .rodata.* .gnu.linkonce.r*) . = ALIGN(0x4); __rom_end = .; } > FLASH /****************/ /* End of FLASH */ /****************/ /*******/ /* RAM */ /*******/ __data_load = LOADADDR(.data); .data : { __data_start = .; *(.data .data.* .gnu.linkonce.d*) /* Ensure that the end of the data section is always word aligned. Initial values are stored in 4-bytes blocks so we must guarantee that these blocks do not fall out the section (otherwise they are truncated and the initial data for the last block are lost). */ . = ALIGN(0x4); __data_end = .; } > RAM AT> FLASH __data_words = (__data_end - __data_start) >> 2; .bss (NOLOAD): { . = ALIGN(0x8); __bss_start = .; *(.bss .bss.*) *(COMMON) . = ALIGN(0x8); /* Align the stack to 64 bits */ __bss_end = .; __interrupt_stack_start = .; *(.interrupt_stacks) . = ALIGN(0x8); __interrupt_stack_end = .; __stack_start = .; . += DEFINED (__stack_size) ? __stack_size : _DEFAULT_STACK_SIZE; . = ALIGN(0x8); __stack_end = .; _end = .; __heap_start = .; __heap_end = ORIGIN(RAM) + LENGTH(RAM); } > RAM __bss_words = (__bss_end - __bss_start) >> 2; /**************/ /* End of RAM */ /**************/ /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning of the section so we begin them at 0. */ /* DWARF 1 */ .debug 0 : { *(.debug) } .line 0 : { *(.line) } /* GNU DWARF 1 extensions */ .debug_srcinfo 0 : { *(.debug_srcinfo) } .debug_sfnames 0 : { *(.debug_sfnames) } /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } /* DWARF 3 */ .debug_pubtypes 0 : { *(.debug_pubtypes) } .debug_ranges 0 : { *(.debug_ranges) } .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } }