diff options
-rw-r--r-- | applications/message_handler/lib/freertos_allocator.cpp | 8 | ||||
-rw-r--r-- | cmake/toolchain/arm-none-eabi-gcc.cmake | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/applications/message_handler/lib/freertos_allocator.cpp b/applications/message_handler/lib/freertos_allocator.cpp index c7fdba6..883ada8 100644 --- a/applications/message_handler/lib/freertos_allocator.cpp +++ b/applications/message_handler/lib/freertos_allocator.cpp @@ -28,18 +28,18 @@ void *operator new[](size_t size) { return pvPortMalloc(size); } -void operator delete(void *ptr) { +void operator delete(void *ptr) noexcept { vPortFree(ptr); } -void operator delete(void *ptr, std::size_t) { +void operator delete(void *ptr, std::size_t) noexcept { vPortFree(ptr); } -void operator delete[](void *ptr) { +void operator delete[](void *ptr) noexcept { vPortFree(ptr); } -void operator delete[](void *ptr, std::size_t) { +void operator delete[](void *ptr, std::size_t) noexcept { vPortFree(ptr); } diff --git a/cmake/toolchain/arm-none-eabi-gcc.cmake b/cmake/toolchain/arm-none-eabi-gcc.cmake index ce54cd5..492abc5 100644 --- a/cmake/toolchain/arm-none-eabi-gcc.cmake +++ b/cmake/toolchain/arm-none-eabi-gcc.cmake @@ -52,7 +52,9 @@ add_compile_options( -mcpu=${GCC_CPU} -mthumb "$<$<CONFIG:DEBUG>:-gdwarf-3>" - "$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>") + "$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>" + -fdata-sections + -ffunction-sections) # Compile defines add_compile_definitions( @@ -88,6 +90,8 @@ if (FLOAT) add_link_options(-mfloat-abi=${FLOAT}) endif() +add_link_options(LINKER:--nmagic,--gc-sections) + # Compilation warnings add_compile_options( -Wall |