diff options
Diffstat (limited to 'core/cortex-m/ec.lds.S')
-rw-r--r-- | core/cortex-m/ec.lds.S | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index ca99d43b1b..3e026331fe 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -40,11 +40,6 @@ MEMORY ORIGIN = CONFIG_PROGRAM_MEMORY_BASE + FW_MEM_OFF(SECTION), \ LENGTH = FW_SIZE(SECTION) #endif /* CONFIG_EXTERNAL_STORAGE */ -#ifdef RSA_PUBLIC_KEY_SIZE - PSTATE(r) : \ - ORIGIN = FW_OFF(SECTION) + FW_SIZE(SECTION), \ - LENGTH = CONFIG_FW_PSTATE_SIZE -#endif #ifdef CONFIG_USB_RAM_SIZE USB_RAM (rw) : \ ORIGIN = CONFIG_USB_RAM_BASE, \ @@ -266,24 +261,6 @@ SECTIONS /* NOTHING MAY GO AFTER THIS! */ } > IRAM -#ifdef RSA_PUBLIC_KEY_SIZE -#ifdef SECTION_IS_RO - .flash_suffix : { - FILL(0xff); - /* - * Put the public key coefficients at the end of the partition - * after the pstate bits. - */ - . = ORIGIN(PSTATE) + LENGTH(PSTATE) - RSA_PUBLIC_KEY_SIZE; - *(.rsa_pubkey) - } > PSTATE -#else /* RW section: we don't need the RSA public key, put it anywhere */ - .flash_suffix : AT(LOADADDR(.data) + SIZEOF(.data)) { - *(.rsa_pubkey) - } > FLASH -#endif -#endif - /* The linker won't notice if the .data section is too big to fit, * apparently because we're sending it into IRAM, not FLASH. The following * symbol isn't used by the code, but running "objdump -t *.elf | grep hey" @@ -291,8 +268,14 @@ 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) >= - (LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION)), + ASSERT((FW_SIZE(SECTION) +#if defined(CONFIG_RWSIG) && defined(SECTION_IS_RO) + - CONFIG_RO_PUBKEY_SIZE +#endif +#if defined(CONFIG_RWSIG) && defined(SECTION_IS_RW) + - CONFIG_RW_SIG_SIZE +#endif + ) >= (LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION)), "No room left in the flash") #ifdef CONFIG_USB_RAM_SIZE |