From 51284296e7e7f2a64a5bb25d57ee68bfb5f17570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 19 Jun 2019 09:36:38 -0400 Subject: [PATCH] [ion][liba] Add 'noinline' attribute for symbols that have to be in internal flash (we don't need to consider these symbol dependencies though) --- ion/src/device/shared/boot/rt0.cpp | 4 ++-- liba/src/assert.c | 2 +- liba/src/memcpy.c | 2 +- liba/src/memset.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ion/src/device/shared/boot/rt0.cpp b/ion/src/device/shared/boot/rt0.cpp index 63f76eaf5..2f6baaba9 100644 --- a/ion/src/device/shared/boot/rt0.cpp +++ b/ion/src/device/shared/boot/rt0.cpp @@ -18,7 +18,7 @@ extern "C" { extern cxx_constructor _init_array_end; } -void abort() { +void __attribute__((noinline)) abort() { #if DEBUG while (1) { } @@ -120,6 +120,6 @@ void __attribute__((noinline)) start() { abort(); } -void __attribute__((interrupt)) isr_systick() { +void __attribute__((interrupt, noinline)) isr_systick() { Ion::Device::Timing::MillisElapsed++; } diff --git a/liba/src/assert.c b/liba/src/assert.c index 89a1f585b..4719beb0c 100644 --- a/liba/src/assert.c +++ b/liba/src/assert.c @@ -1,6 +1,6 @@ #include #include -void __assert(const char * expression, const char * file, int line) { +void __attribute__((noinline)) __assert(const char * expression, const char * file, int line) { abort(); } diff --git a/liba/src/memcpy.c b/liba/src/memcpy.c index 51b531679..125206a4a 100644 --- a/liba/src/memcpy.c +++ b/liba/src/memcpy.c @@ -3,7 +3,7 @@ // Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51205 void * memcpy(void * dst, const void * src, size_t n) __attribute__((externally_visible)); -void * memcpy(void * dst, const void * src, size_t n) { +void * __attribute__((noinline)) memcpy(void * dst, const void * src, size_t n) { char * destination = (char *)dst; char * source = (char *)src; diff --git a/liba/src/memset.c b/liba/src/memset.c index 45f1f8947..48660ec19 100644 --- a/liba/src/memset.c +++ b/liba/src/memset.c @@ -3,7 +3,7 @@ // Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51205 void * memset(void * b, int c, size_t len) __attribute__((externally_visible)); -void * memset(void * b, int c, size_t len) { +void * __attribute__((noinline)) memset(void * b, int c, size_t len) { char * destination = (char *)b; while (len--) { *destination++ = (unsigned char)c;