From f10d3564e1739e43ed3e698839b57bc12997126a Mon Sep 17 00:00:00 2001
From: Pascal de Bruijn <pmjdebruijn@pcode.nl>
Date: Thu, 16 Jan 2020 02:13:28 +0100
Subject: [PATCH] STM32 RODATA LENGTH (#16580)

---
 .../share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld     | 2 +-
 .../share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld     | 2 +-
 buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld  | 2 +-
 buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld           | 2 +-
 buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld
index 1ed03caa0a..1e720c17c5 100644
--- a/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld
+++ b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_256K.ld
@@ -1,7 +1,7 @@
 MEMORY
 {
   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
-  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 256K - 28K
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 256K - 28K - 4K
 }
 
 /* Provide memory region aliases for common.inc */
diff --git a/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld
index feb6c0d3ba..248b7781cf 100644
--- a/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld
+++ b/buildroot/share/PlatformIO/ldscripts/STM32F103RC_SKR_MINI_512K.ld
@@ -1,7 +1,7 @@
 MEMORY
 {
   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
-  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K - 4K
 }
 
 /* Provide memory region aliases for common.inc */
diff --git a/buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld b/buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld
index feb6c0d3ba..248b7781cf 100644
--- a/buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld
+++ b/buildroot/share/PlatformIO/ldscripts/STM32F103RE_SKR_E3_DIP.ld
@@ -1,7 +1,7 @@
 MEMORY
 {
   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
-  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K - 4K
 }
 
 /* Provide memory region aliases for common.inc */
diff --git a/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld b/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld
index 241edc5407..f279347ee5 100644
--- a/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld
+++ b/buildroot/share/PlatformIO/ldscripts/fysetc_aio_ii.ld
@@ -5,7 +5,7 @@
 MEMORY
 {
 	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
-	rom (rx)  : ORIGIN = 0x08010000, LENGTH = 256K-40K
+	rom (rx)  : ORIGIN = 0x08010000, LENGTH = 256K - 40K - 4K
 }
 
 /* Provide memory region aliases for common.inc */
diff --git a/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld b/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld
index 785345543c..d8a138ca2e 100755
--- a/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld
+++ b/buildroot/share/PlatformIO/ldscripts/mks_robin_mini.ld
@@ -1,7 +1,7 @@
 MEMORY
 {
   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40
-  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K
+  rom (rx)  : ORIGIN = 0x08007000, LENGTH = 512K - 28K - 4K
 }
 
 /* Provide memory region aliases for common.inc */