Use -Os for STM apps. Fix altos.ld to matchall .rodata* sections
authorKeith Packard <keithp@keithp.com>
Fri, 23 Mar 2012 08:42:32 +0000 (01:42 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 29 Mar 2012 04:37:04 +0000 (21:37 -0700)
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 <keithp@keithp.com>
src/megametrum-v0.1/Makefile
src/stm-demo/Makefile
src/stm/Makefile.defs
src/stm/altos.ld

index ed91d04f0ce650472dbc1694924393a83143b15a..510bee6acb989a0faeb27c2f7569f9fe64eeb252 100644 (file)
@@ -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
 
index f2e6618e19ace9e83609d3d118e067f1202c0e21..f1655d57147efee2457093cec5d8bc53e2f8bc63 100644 (file)
@@ -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
 
index c799231a909e5e9093c85cc35fdad1e2366855c5..6191ec45d37a6bd4df4916eaff082b7e33a33d12 100644 (file)
@@ -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
index 4e95566651ed73ba52375b1cdec0834a05dd2700..7fede5589206ec5a3cd000cfc4dd4f904fb1c8d0 100644 (file)
@@ -36,8 +36,8 @@ SECTIONS {
 
        .text : {
                *(.interrupt)   /* Interrupt vectors */
-               *(.text       /* Executable code */
-               *(.rodata     /* Constants */
+               *(.text*)       /* Executable code */
+               *(.rodata*)     /* Constants */
        } > rom
 
        .ARM.exidx : {