summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Sukhomlinov <sukhomlinov@google.com>2021-10-11 21:04:48 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-12 17:33:02 +0000
commit0b7ad4919624241ba3f6ed4be304213d3e356657 (patch)
treec8f88f7873e0cc64b6e240ca33dd39ecc40d1401
parent7e66297fc54237b1867e448c1992c837f036a275 (diff)
downloadchrome-ec-firmware-chameleon-14280.B-cr50_stab.tar.gz
cr50: place .text.fips_checksum immediately after FIPS modulefirmware-chameleon-14280.B-cr50_stab
.text.fips_checksum section was placed after .text which resulted in different address for it. Since address of this section is used in FIPS module it resulted in different digest computed. BUG=b:138578318 TEST=make BOARD=cr50, check map file to ensure .text.fips_checksum is just after FIPS module. Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> Change-Id: Ia054fec9191eac8818dcde139320eddbd7c8085b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218580 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--core/cortex-m/ec.lds.S25
1 files changed, 15 insertions, 10 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index b85ad692b8..7249ddeb69 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -110,7 +110,22 @@ SECTIONS
__fips_module_start = .;
KEEP(*(.text.fips))
KEEP(*(.rodata.fips))
+ . = ALIGN(4);
__fips_module_end = .;
+ } > FLASH =0xFFFFFFFF
+ /*
+ * Put the FIPS checksum in its own section, so it's easier to inject it
+ * into the elf file. This section should be adjacent to last section of
+ * FIPS module which is rodata.fips.
+ */
+ .text.fips_checksum : {
+ __fips_module_checksum_start = .;
+ KEEP(*(.rodata.fips.checksum))
+ __fips_module_checksum_end = .;
+ } > FLASH =0xFFFFFFFF
+
+ /* The rest of .text sections. */
+ .text.__main : {
. = ALIGN(4);
__ap_ro_root_key_hash_start = . ;
*(.rodata.root_key_hash)
@@ -146,16 +161,6 @@ SECTIONS
#endif
. = ALIGN(4);
- /*
- * Put the FIPS checksum in its own section, so it's easier to inject it
- * into the elf file.
- */
- .text.fips_checksum : {
- __fips_module_checksum_start = .;
- KEEP(*(.rodata.fips.checksum))
- __fips_module_checksum_end = .;
- }
- . = ALIGN(4);
.rodata : {
/* Symbols defined here are declared in link_defs.h */
__irqprio = .;