From dfc81cecad1c71c45f9fff6eab8b094b95e6feec Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 2 Nov 2016 16:20:49 +0100 Subject: [PATCH] Fix Atmel ARM Linker script for gcc 5.4.1 (#3982) Copy .init and .fni section over from the STM32 linker scripts to make targets like AR9X buildable again. Tested by @sreichholf on a AR9X board --- radio/src/targets/sky9x/sam3s2c_flash.ld | 3 +++ radio/src/targets/sky9x/sam3s4c_flash.ld | 5 ++++- radio/src/targets/sky9x/sam3s8c_flash.ld | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/sky9x/sam3s2c_flash.ld b/radio/src/targets/sky9x/sam3s2c_flash.ld index 54dde2569..965328c0e 100644 --- a/radio/src/targets/sky9x/sam3s2c_flash.ld +++ b/radio/src/targets/sky9x/sam3s2c_flash.ld @@ -86,6 +86,9 @@ SECTIONS . = ALIGN(4); /* Align the start of the rodata part */ *(.rodata) *(.rodata.*) + + KEEP (*(.init)) + KEEP (*(.fini)) . = ALIGN(4); /* Align the end of the section */ } > FLASH = 0 diff --git a/radio/src/targets/sky9x/sam3s4c_flash.ld b/radio/src/targets/sky9x/sam3s4c_flash.ld index 083dc52d9..743bcc97c 100644 --- a/radio/src/targets/sky9x/sam3s4c_flash.ld +++ b/radio/src/targets/sky9x/sam3s4c_flash.ld @@ -93,7 +93,10 @@ SECTIONS . = ALIGN(4); /* Align the start of the rodata part */ *(.rodata) *(.rodata.*) - + + KEEP (*(.init)) + KEEP (*(.fini)) + . = ALIGN(4); /* Align the end of the section */ } > FLASH = 0 _etext = .; /* Provide the name for the end of this section */ diff --git a/radio/src/targets/sky9x/sam3s8c_flash.ld b/radio/src/targets/sky9x/sam3s8c_flash.ld index ee9bdc22d..fa7227a9b 100644 --- a/radio/src/targets/sky9x/sam3s8c_flash.ld +++ b/radio/src/targets/sky9x/sam3s8c_flash.ld @@ -92,7 +92,10 @@ SECTIONS . = ALIGN(4); /* Align the start of the rodata part */ *(.rodata) *(.rodata.*) - + + KEEP (*(.init)) + KEEP (*(.fini)) + . = ALIGN(4); /* Align the end of the section */ } > FLASH = 0 _etext = .; /* Provide the name for the end of this section */