summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-01-13 17:15:49 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-14 21:50:10 +0000
commit03f66537a2bdd039341b03b073c63c6554b8cc10 (patch)
tree1a5ec7a4e7241121d4eda4c0fbe92e401108c725 /core
parent34f927724f22d79c8e4c752189dc19b7fd4f7735 (diff)
downloadchrome-ec-03f66537a2bdd039341b03b073c63c6554b8cc10.tar.gz
fix off-by-one in flash size check
__hey_flash_used is actually a size rather than an offset, it might be equal to flash if we use every single byte. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=samus BUG=none TEST=make buildall with the following CLs, samus_pd uses every single byte of flash. Change-Id: I98ddac73fab80c44ca2743ab2847321d71746752 Reviewed-on: https://chromium-review.googlesource.com/240539 Reviewed-by: Alec Berg <alecaberg@chromium.org> Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S2
-rw-r--r--core/cortex-m0/ec.lds.S2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 5d70f366e8..b5818560b9 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -267,7 +267,7 @@ SECTIONS
* explicit ASSERT afterwards will cause the linker to abort if we use too
* much. */
__hey_flash_used = LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION);
- ASSERT(FW_SIZE(SECTION) >
+ ASSERT(FW_SIZE(SECTION) >=
(LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION)),
"No room left in the flash")
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S
index 4a4ddd23f4..c3ba800b0e 100644
--- a/core/cortex-m0/ec.lds.S
+++ b/core/cortex-m0/ec.lds.S
@@ -234,7 +234,7 @@ SECTIONS
* explicit ASSERT afterwards will cause the linker to abort if we use too
* much. */
__hey_flash_used = LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION);
- ASSERT(FW_SIZE(SECTION) >
+ ASSERT(FW_SIZE(SECTION) >=
(LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION)),
"No room left in the flash")