summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-10-11 18:24:56 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-13 00:56:08 +0000
commit191dfd83456aef0813160ef4ac53742f8a1d7756 (patch)
treefffa8e9be90751b7a13742c3d393427365cecd4f
parent425146285cd32817f3db6b58a649067173e90aee (diff)
downloadchrome-ec-191dfd83456aef0813160ef4ac53742f8a1d7756.tar.gz
core/cortex-m: Fix RW image alignment when using clang (lld)
This change forces the LMA and VMA to start immediately after the .data section; both LMA and VMA are forced to be equal. The change removes the BYTE(0xFF), since lld will allocate space for this byte and throw off the alignment. The ASSERT line verifies that the __image_size is still correctly aligned when building with both gcc and clang. BRANCH=none BUG=b:172020503 TEST=make buildall TEST=make CC=arm-none-eabi-clang BOARD=dartmonkey Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I00d4e8f346232d1c5b8b04d397459760976a8a8b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169965 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r--core/cortex-m/ec.lds.S4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index fcf7a1fecc..88fe51a6f3 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -502,10 +502,8 @@ SECTIONS
#if !(defined(SECTION_IS_RW) && (CONFIG_FLASH_WRITE_SIZE > 4))
__image_size = __flash_used;
#else
- .rw_image_size_alignment :
+ .rw_image_size_alignment FLASH_USED_END : AT(FLASH_USED_END)
{
- . = ORIGIN(FLASH) + __flash_used;
- BYTE(0xFF);
. = ALIGN (CONFIG_FLASH_WRITE_SIZE);
} > FLASH = 0xFF