LPC11C24: Enabled LTO; binary size 26.6k

This commit is contained in:
Pavel Kirienko 2014-04-16 18:57:59 +04:00
parent 65c6fdf396
commit 698a3ad325
2 changed files with 5 additions and 7 deletions

View File

@ -44,13 +44,10 @@ DEPDIR = $(BUILDDIR)/dep
DEF += -DNDEBUG -DCHIP_LPC11CXX -DCORE_M0 -DTHUMB_NO_INTERWORKING -U__STRICT_ANSI__
FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork
FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork -flto -Os -g3 -Wall -Wextra -Werror -ffunction-sections \
-fdata-sections -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer
C_CPP_FLAGS = $(FLAGS) -Os -g3 -Wall -Wextra -Werror -ffunction-sections -fdata-sections \
-fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer
# Dependencies
C_CPP_FLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
C_CPP_FLAGS = $(FLAGS) -MD -MP -MF $(DEPDIR)/$(@F).d
CFLAGS = $(C_CPP_FLAGS) -std=c99

View File

@ -135,8 +135,9 @@ extern void __stack_end(void);
/**
* Vector table for LPC11Cxx
* Must be explicitly defined 'used', otherwise LTO optimizer will discard it.
*/
__attribute__ ((section("vectors")))
__attribute__ ((used, section("vectors")))
void (* const VectorTable[64])(void) =
{
__stack_end, // The initial stack pointer