nrf: Enable Link-time optimizations

pull/1/head
Ayke van Laethem 2017-10-24 03:29:19 +02:00 committed by Damien George
parent 4e083819f3
commit 4838b398af
4 changed files with 4 additions and 5 deletions

View File

@ -74,14 +74,13 @@ CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES))
CFLAGS += $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(COPT) $(NRF_DEFINES) $(CFLAGS_MOD)
CFLAGS += -fno-strict-aliasing
CFLAGS += -fstack-usage
CFLAGS += -fdata-sections -ffunction-sections
CFLAGS += -Iboards/$(BOARD)
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
CFLAGS += -flto
LDFLAGS = $(CFLAGS)
LDFLAGS += -Xlinker -Map=$(@:.elf=.map)
LDFLAGS += -mthumb -mabi=aapcs -T $(LD_FILE) -L boards/
LDFLAGS += -Wl,--gc-sections
#Debugging/Optimization
ifeq ($(DEBUG), 1)

View File

@ -103,7 +103,7 @@ void SWI3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"
void SWI4_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
void SWI5_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
const func __Vectors[] __attribute__ ((section(".isr_vector"))) = {
const func __Vectors[] __attribute__ ((section(".isr_vector"),used)) = {
(func)&_estack,
Reset_Handler,
NMI_Handler,

View File

@ -107,7 +107,7 @@ void SPIM2_SPIS2_SPI2_IRQHandler (void) __attribute__ ((weak, alias("Default_Han
void RTC2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
void I2S_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
const func __Vectors[] __attribute__ ((section(".isr_vector"))) = {
const func __Vectors[] __attribute__ ((section(".isr_vector"),used)) = {
(func)&_estack,
Reset_Handler,
NMI_Handler,

View File

@ -114,7 +114,7 @@ void CRYPTOCELL_IRQHandler (void) __attribute__ ((weak, alias("Default_Han
void SPIM3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
void PWM3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler")));
const func __Vectors[] __attribute__ ((section(".isr_vector"))) = {
const func __Vectors[] __attribute__ ((section(".isr_vector"),used)) = {
(func)&_estack,
Reset_Handler,
NMI_Handler,