lib: Update sam4s code so that it works with gcc's -flto feature

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-12-26 20:58:07 -05:00
parent 6db21d3033
commit 519f2cff41
3 changed files with 16 additions and 2 deletions

View File

@ -23,7 +23,8 @@ run. See cmsis-sam4e8e.patch for the modifications.
The sam4s directory contains code from the The sam4s directory contains code from the
Atmel.SAM4S_DFP.1.0.56.atpack zip file found at: Atmel.SAM4S_DFP.1.0.56.atpack zip file found at:
http://packs.download.atmel.com/ http://packs.download.atmel.com/
version 1.0.56 (extracted on 20181220). version 1.0.56 (extracted on 20181220). It has been modified to
compile with gcc's LTO feature. See sam4s.patch for the modifications.
The samd21 directory contains code from the The samd21 directory contains code from the
Atmel.SAMD21_DFP.1.3.304.atpack zip file found at: Atmel.SAMD21_DFP.1.3.304.atpack zip file found at:

View File

@ -111,7 +111,7 @@ void ACC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void UDP_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); void UDP_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
/* Exception Table */ /* Exception Table */
__attribute__ ((section(".vectors"))) __attribute__ ((section(".vectors"))) __attribute__((externally_visible))
const DeviceVectors exception_table = { const DeviceVectors exception_table = {
/* Configure Initial Stack Pointer, using linker-generated symbols */ /* Configure Initial Stack Pointer, using linker-generated symbols */

13
lib/sam4s/sam4s.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/lib/sam4s/gcc/gcc/startup_sam4s.c b/lib/sam4s/gcc/gcc/startup_sam4s.c
index 3792319e..ae19328a 100644
--- a/lib/sam4s/gcc/gcc/startup_sam4s.c
+++ b/lib/sam4s/gcc/gcc/startup_sam4s.c
@@ -111,7 +111,7 @@ void ACC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
void UDP_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
/* Exception Table */
-__attribute__ ((section(".vectors")))
+__attribute__ ((section(".vectors"))) __attribute__((externally_visible))
const DeviceVectors exception_table = {
/* Configure Initial Stack Pointer, using linker-generated symbols */