From ffdf5831594cbe5f5326b537e49aad6caf2fbf70 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 8 Dec 2011 11:02:02 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3580 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld | 7 +- os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld | 7 +- os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld | 7 +- os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld | 7 +- os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld | 7 +- os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld | 7 +- os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld | 7 +- os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld | 7 +- .../GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld | 173 +++++++++++++++++++++ os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld | 7 +- os/ports/GCC/ARMCMx/rules.mk | 2 +- 11 files changed, 210 insertions(+), 28 deletions(-) create mode 100644 os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld (limited to 'os/ports/GCC') diff --git a/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld index 6964c4467..23b6d7a88 100644 --- a/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld +++ b/os/ports/GCC/ARMCMx/LPC11xx/ld/LPC1114.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld index cbd12b2aa..517aa3e44 100644 --- a/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld +++ b/os/ports/GCC/ARMCMx/LPC13xx/ld/LPC1343.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld index 8045d210d..301f4f37f 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F100xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld index 4dd94bd7d..f1b7a089a 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld index c200c342b..16049fa32 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xE.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld index 614ef3187..6b66f9406 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xG.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld index 0b7604ac8..9e95543a2 100644 --- a/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld +++ b/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F107xC.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld index d3533a8f2..27716a62f 100644 --- a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld +++ b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG.ld @@ -95,13 +95,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld new file mode 100644 index 000000000..b11a2cca1 --- /dev/null +++ b/os/ports/GCC/ARMCMx/STM32F4xx/ld/STM32F407xG_CCM.ld @@ -0,0 +1,173 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/* + * ST32F407xG memory setup. + */ +__main_stack_size__ = 0x0400; +__process_stack_size__ = 0x0400; + +MEMORY +{ + flash : org = 0x08000000, len = 1M + ram : org = 0x20000000, len = 112k + ethram : org = 0x2001C000, len = 16k + ccmram : org = 0x10000000, len = 64k +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(vectors)) + } > flash + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > flash + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > flash + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > flash + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > flash + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > flash + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > flash + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > flash + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > flash + + _etext = .; + _textdata = _etext; + + .stacks : + { + . = ALIGN(8); + __main_stack_base__ = .; + . += __main_stack_size__; + . = ALIGN(8); + __main_stack_end__ = .; + __process_stack_base__ = .; + __main_thread_stack_base__ = .; + . += __process_stack_size__; + . = ALIGN(8); + __process_stack_end__ = .; + __main_thread_stack_end__ = .; + } > ccmram + + .ccm : + { + PROVIDE(_cmm_start = .); + . = ALIGN(4); + *(.bss.mainthread.*) + . = ALIGN(4); + *(.bss._idle_thread_wa) + . = ALIGN(4); + *(.bss.rlist) + . = ALIGN(4); + *(.bss.vtlist) + . = ALIGN(4); + *(.bss.endmem) + . = ALIGN(4); + *(.bss.nextmem) + . = ALIGN(4); + *(.bss.default_heap) + . = ALIGN(4); + PROVIDE(_cmmend = .); + } > ccmram + + .data : + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + . = ALIGN(4); + *(.data.*) + . = ALIGN(4); + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram AT > flash + + .bss : + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + . = ALIGN(4); + *(.bss.*) + . = ALIGN(4); + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + +__heap_base__ = _end; +__heap_end__ = __ram_end__; diff --git a/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld b/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld index a4f78b500..342dd3556 100644 --- a/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld +++ b/os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld @@ -93,13 +93,14 @@ SECTIONS *(.eh_frame) } > flash - .endtext : ONLY_IF_RO + .textalign : ONLY_IF_RO { . = ALIGN(8); - _etext = .; - _textdata = _etext; } > flash + _etext = .; + _textdata = _etext; + .stacks : { . = ALIGN(8); diff --git a/os/ports/GCC/ARMCMx/rules.mk b/os/ports/GCC/ARMCMx/rules.mk index cda8ceda2..e53105e1c 100644 --- a/os/ports/GCC/ARMCMx/rules.mk +++ b/os/ports/GCC/ARMCMx/rules.mk @@ -15,7 +15,7 @@ OPT = $(USE_OPT) COPT = $(USE_COPT) CPPOPT = $(USE_CPPOPT) ifeq ($(USE_LINK_GC),yes) - OPT += -ffunction-sections -fdata-sections + OPT += -ffunction-sections -fdata-sections -fno-common endif # Source files groups and paths -- cgit v1.2.3