]> code.bitgloo.com Git - clyne/stm-game.git/commitdiff
customize link script to remove heap section
authorClyne Sullivan <clyne@bitgloo.com>
Sat, 28 Nov 2020 23:18:53 +0000 (18:18 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Sat, 28 Nov 2020 23:18:53 +0000 (18:18 -0500)
Makefile
STM32L011x4.ld [new file with mode: 0644]

index efef021e803fe3040fa05734328de59ad0e3cf9d..128703df90d3a5f871acf27d4456351de05fa86d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,8 @@ include $(CHIBIOS)/tools/mk/autobuild.mk
 #include $(CHIBIOS)/test/oslib/oslib_test.mk\r
 \r
 # Define linker script file here\r
-LDSCRIPT= $(STARTUPLD)/STM32L011x4.ld\r
+#LDSCRIPT= $(STARTUPLD)/STM32L011x4.ld\r
+LDSCRIPT= ./STM32L011x4.ld\r
 \r
 # C sources that can be compiled in ARM or THUMB mode depending on the global\r
 # setting.\r
diff --git a/STM32L011x4.ld b/STM32L011x4.ld
new file mode 100644 (file)
index 0000000..c583d02
--- /dev/null
@@ -0,0 +1,85 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+/*\r
+ * STM32L011x4 memory setup.\r
+ */\r
+MEMORY\r
+{\r
+    flash0 (rx) : org = 0x08000000, len = 16k\r
+    flash1 (rx) : org = 0x00000000, len = 0\r
+    flash2 (rx) : org = 0x00000000, len = 0\r
+    flash3 (rx) : org = 0x00000000, len = 0\r
+    flash4 (rx) : org = 0x00000000, len = 0\r
+    flash5 (rx) : org = 0x00000000, len = 0\r
+    flash6 (rx) : org = 0x00000000, len = 0\r
+    flash7 (rx) : org = 0x00000000, len = 0\r
+    ram0   (wx) : org = 0x20000000, len = 2k\r
+    ram1   (wx) : org = 0x00000000, len = 0\r
+    ram2   (wx) : org = 0x00000000, len = 0\r
+    ram3   (wx) : org = 0x00000000, len = 0\r
+    ram4   (wx) : org = 0x00000000, len = 0\r
+    ram5   (wx) : org = 0x00000000, len = 0\r
+    ram6   (wx) : org = 0x00000000, len = 0\r
+    ram7   (wx) : org = 0x00000000, len = 0\r
+}\r
+\r
+/* For each data/text section two region are defined, a virtual region\r
+   and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash0);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash0);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash0);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash0);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
+\r
+/* RAM region to be used for Main stack. This stack accommodates the processing\r
+   of all exceptions and interrupts.*/\r
+REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for the process stack. This is the stack used by\r
+   the main() function.*/\r
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for data segment.*/\r
+REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash0);\r
+\r
+/* RAM region to be used for BSS segment.*/\r
+REGION_ALIAS("BSS_RAM", ram0);\r
+\r
+/* RAM region to be used for the default heap.*/\r
+REGION_ALIAS("HEAP_RAM", ram1);\r
+\r
+/* Generic rules inclusion.*/\r
+INCLUDE rules.ld\r