From: Keith Packard Date: Fri, 23 Mar 2012 08:42:32 +0000 (-0700) Subject: Use -Os for STM apps. Fix altos.ld to matchall .rodata* sections X-Git-Tag: 1.0.9.4~3 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c1531fb26461b9f4ec39672bbfaeb70e6f4d1056 Use -Os for STM apps. Fix altos.ld to matchall .rodata* sections Without .rodata*, it would stick the flash copy of the data on top of any further .rodata* sections. Fortunately, the linker catches that and complains... Signed-off-by: Keith Packard --- diff --git a/src/megametrum-v0.1/Makefile b/src/megametrum-v0.1/Makefile index ed91d04f..510bee6a 100644 --- a/src/megametrum-v0.1/Makefile +++ b/src/megametrum-v0.1/Makefile @@ -36,7 +36,7 @@ PRODUCT=MegaMetrum-v0.1 PRODUCT_DEF=-DMEGAMETRUM IDPRODUCT=0x000a -CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) +CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -Os -g PROG=megametrum-v0.1 diff --git a/src/stm-demo/Makefile b/src/stm-demo/Makefile index f2e6618e..f1655d57 100644 --- a/src/stm-demo/Makefile +++ b/src/stm-demo/Makefile @@ -34,7 +34,7 @@ PRODUCT=StmDemo-v0.0 PRODUCT_DEF=-DSTM_DEMO IDPRODUCT=0x000a -CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) +CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os PROG=stm-demo diff --git a/src/stm/Makefile.defs b/src/stm/Makefile.defs index c799231a..6191ec45 100644 --- a/src/stm/Makefile.defs +++ b/src/stm/Makefile.defs @@ -19,6 +19,8 @@ endif AO_CFLAGS=-I. -I../stm -I../core -I.. STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS) +LDFLAGS=-L../stm -Wl,-Taltos.ld + NICKLE=nickle V=0 diff --git a/src/stm/altos.ld b/src/stm/altos.ld index 4e955666..7fede558 100644 --- a/src/stm/altos.ld +++ b/src/stm/altos.ld @@ -36,8 +36,8 @@ SECTIONS { .text : { *(.interrupt) /* Interrupt vectors */ - *(.text) /* Executable code */ - *(.rodata) /* Constants */ + *(.text*) /* Executable code */ + *(.rodata*) /* Constants */ } > rom .ARM.exidx : {