From d3225e63daf32f02e46ad6c5ea865c6b870b1232 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 14 Oct 2021 22:19:09 +0000 Subject: core/cortex-m: Use original __data_lma_start when compiling with gcc https://crrev.com/c/3169964 changed __data_lma_start from "." to LOADADDR(.data) to fix dartmonkey when compiling with clang. This changed the LMA address on some boards, such as voxel. Even though the new address looks correct (matches start of .data section), we are seeing an exception on voxel during startup. For now, keep clang and gcc separate until we can diagnose the issue. BRANCH=none BUG=b:172020503, b:202863352 TEST=make buildall -j Signed-off-by: Tom Hughes Change-Id: I8313210c89559a6159f311821a18e7b310a3ada6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3224378 Reviewed-by: caveh jalali Commit-Queue: caveh jalali Tested-by: caveh jalali --- core/cortex-m/ec.lds.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index b099691630..1c9402ebde 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -351,7 +351,14 @@ SECTIONS __data_lma_start = ORIGIN(ROM_RESIDENT_VMA); #define INIT_ROM_LMA (ORIGIN(ROM_RESIDENT_VMA) + SIZEOF(.data)) #else +/* + * TODO(b/202863352): Unify clang and gcc behavior. + */ +#ifdef __clang__ __data_lma_start = LOADADDR(.data); +#else + __data_lma_start = .; +#endif #define INIT_ROM_LMA ORIGIN(ROM_RESIDENT_VMA) #endif -- cgit v1.2.1