From 3cbf4499e1903bb456febf2bae7effde109ee935 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Sat, 21 Jan 2012 21:18:06 -0500 Subject: [PATCH] ld: make sure current pointer never goes backwards Fixes linking on ld version 2.22. --- .../STM32F10x/link_STM32103CB_CC_Rev1_sections.ld | 11 ++--------- flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld | 10 ++-------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld index d3e9f797e..ac579364b 100644 --- a/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM32103CB_CC_Rev1_sections.ld @@ -98,16 +98,9 @@ SECTIONS _init_stack_top = . - 4 ; } > SRAM + _eram = ORIGIN(SRAM) + LENGTH(SRAM) ; + _ebss = _eram ; - _free_ram = . ; - .free_ram (NOLOAD) : - { - . = ORIGIN(SRAM) + LENGTH(SRAM) - _free_ram ; - /* This is used by the startup in order to initialize the .bss section */ - _ebss = . ; - _eram = . ; - } > SRAM - /* keep the heap section at the end of the SRAM * this will allow to claim the remaining bytes not used * at run time! (done by the reset vector). diff --git a/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld b/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld index 066fa01ee..f23ed327f 100644 --- a/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld +++ b/flight/PiOS/STM32F10x/link_STM3210E_OP_sections.ld @@ -275,14 +275,8 @@ SECTIONS _init_stack_top = . - 4 ; } > RAM - _free_ram = . ; - .free_ram (NOLOAD) : - { - . = ORIGIN(RAM) + LENGTH(RAM) - _free_ram ; - /* This is used by the startup in order to initialize the .bss section */ - _ebss = . ; - _eram = . ; - } > RAM + _eram = ORIGIN(SRAM) + LENGTH(SRAM) ; + _ebss = _eram ; /* keep the heap section at the end of the SRAM * this will allow to claim the remaining bytes not used