aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-11-15 02:43:01 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-11-15 02:49:38 -0500
commitff2a3476be5cf0e01b2d3e7a430d31a077618d5f (patch)
tree3ca58e97b4675ad1b3ee59d3a5ac736b0c34adbc
parentc51d6177c5359e35c10e93ffce13ab596a916235 (diff)
downloadlibrambutan-ff2a3476be5cf0e01b2d3e7a430d31a077618d5f.tar.gz
librambutan-ff2a3476be5cf0e01b2d3e7a430d31a077618d5f.zip
Make vector table symbols family-specific during linking.
- support/make/target-config.mk: add LD_FAMILY_PATH, the directory to search for STM32 family-specific link configuration files. For now, this is just a stub which points to support/ld/stm32/f1/performance, since that's all we currently support. We can add the logic to support different STM32 families here later. - Makefile: Pass -L $(LD_FAMILY_PATH) to linker. - Rename support/ld/names.inc to support/ld/stm32/f1/performance/vector_symbols.inc. - common.inc: INCLUDE vector_symbols.inc instead of names.inc. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--Makefile2
-rw-r--r--support/ld/common.inc11
-rw-r--r--support/ld/stm32/f1/performance/vector_symbols.inc (renamed from support/ld/names.inc)0
-rw-r--r--support/make/target-config.mk8
4 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 7b1fc21..11a3ccc 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall $(GLOBAL_FLAGS)
GLOBAL_ASFLAGS := -mcpu=cortex-m3 -march=armv7-m -mthumb \
-x assembler-with-cpp $(GLOBAL_FLAGS)
LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \
- -mcpu=cortex-m3 -mthumb -Xlinker \
+ -mcpu=cortex-m3 -mthumb -Xlinker -L $(LD_FAMILY_PATH) \
--gc-sections --print-gc-sections --march=armv7-m -Wall
##
diff --git a/support/ld/common.inc b/support/ld/common.inc
index b53c4f6..c6fa13a 100644
--- a/support/ld/common.inc
+++ b/support/ld/common.inc
@@ -13,11 +13,14 @@ SEARCH_DIR(.)
*/
GROUP(libgcc.a libc.a libm.a)
-/* These force the linker to search for particular symbols from
- * the start of the link process and thus ensure the user's
- * overrides are picked up
+/*
+ * These force the linker to search for vector table symbols.
+ *
+ * These symbols vary by STM32 family (and also within families).
+ * It's up to the build system to configure the link's search path
+ * properly for the target MCU.
*/
-INCLUDE names.inc
+INCLUDE vector_symbols.inc
/* STM32 vector table. See stm32_vector_table.S */
EXTERN(__cs3_stm32_vector_table)
diff --git a/support/ld/names.inc b/support/ld/stm32/f1/performance/vector_symbols.inc
index 6d7ff6e..6d7ff6e 100644
--- a/support/ld/names.inc
+++ b/support/ld/stm32/f1/performance/vector_symbols.inc
diff --git a/support/make/target-config.mk b/support/make/target-config.mk
index c12fe3b..f935cad 100644
--- a/support/make/target-config.mk
+++ b/support/make/target-config.mk
@@ -50,6 +50,14 @@ ifeq ($(BOARD), olimex_stm32_h103)
SRAM_SIZE := 20480
endif
+# STM32 family-specific configuration values.
+
+# NB: this only works for STM32F1 performance line chips, but those
+# are the only ones we support at this time. If you add support for
+# STM32F1 connectivity line MCUs or other STM32 families, this section
+# will need to change.
+LD_FAMILY_PATH := $(LDDIR)/stm32/f1/performance
+
# Memory target-specific configuration values
ifeq ($(MEMORY_TARGET), ram)