summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-08-25 15:29:17 -0500
committerCommit Bot <commit-bot@chromium.org>2021-09-07 16:47:09 +0000
commit519a3cf7cdef12437ae27a58d0dd70e12ca07278 (patch)
treebfc60a01ed400ce2626c055827e9eed4a3e1ee24
parentb1c486b80bf708b10c0a48a91ef255ac72e38076 (diff)
downloadchrome-ec-519a3cf7cdef12437ae27a58d0dd70e12ca07278.tar.gz
cr50: move fips checksum into its own section
This change moves the fips checksum into its own section, so objcopy can be used to update the fips checksum in the elf files. BUG=none TEST=make buildall -j Change-Id: I8004c7efaf607eabd2932ecb9fdf377e0c68b6c0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120046 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--core/cortex-m/ec.lds.S17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 4471287404..d8bb0f545e 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -98,7 +98,6 @@ SECTIONS
. = ALIGN(4);
KEEP(*(.rodata.pstate))
-
/**
* Reserve a space for FIPS crypto module.
* We compute sha256 for this block to check integrity, but
@@ -113,11 +112,6 @@ SECTIONS
KEEP(*(.rodata.fips))
__fips_module_end = .;
. = ALIGN(4);
- __fips_module_checksum_start = .;
- KEEP(*(.rodata.fips.checksum))
- __fips_module_checksum_end = .;
-
- . = ALIGN(4);
STRINGIFY(OUTDIR/core/CORE/init.o) (.text)
#if defined(CHIP_FAMILY_NPCX7) && !defined(CONFIG_HIBERNATE_PSL)
/* Keep hibernate utility in last code ram block */
@@ -146,6 +140,17 @@ SECTIONS
} > FLASH
# endif /* !CONFIG_FLASH_PHYSICAL */
#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 */