From c078159ad04dd04b087338506398e98365d31ec0 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 12 Sep 2023 17:00:49 +0200 Subject: [PATCH] test-size: use 'strip' to remove libc debug symbols --- config/examples/stm32l5-nonsecure-dualbank.config | 6 +++--- include/user_settings.h | 7 ++++++- tools/test.mk | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config/examples/stm32l5-nonsecure-dualbank.config b/config/examples/stm32l5-nonsecure-dualbank.config index 6e53a4c68..2d5ca45c2 100644 --- a/config/examples/stm32l5-nonsecure-dualbank.config +++ b/config/examples/stm32l5-nonsecure-dualbank.config @@ -18,8 +18,8 @@ V?=0 SPMATH?=1 RAM_CODE?=0 DUALBANK_SWAP?=1 -WOLFBOOT_PARTITION_SIZE?=0x38000 +WOLFBOOT_PARTITION_SIZE?=0x30000 WOLFBOOT_SECTOR_SIZE?=0x2000 -WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08008000 -WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08108000 +WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08010000 +WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08110000 WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF diff --git a/include/user_settings.h b/include/user_settings.h index abb9638f7..81f4d6a56 100644 --- a/include/user_settings.h +++ b/include/user_settings.h @@ -100,8 +100,9 @@ extern int tolower(int c); /* Some ECC options are disabled to reduce size */ # if !defined(WOLFCRYPT_SECURE_MODE) -# ifndef WOLFBOOT_TPM +# if !defined(WOLFBOOT_TPM) # define NO_ECC_SIGN +# define NO_ECC_DHE # define NO_ECC_EXPORT # define NO_ECC_KEY_EXPORT # else @@ -132,6 +133,10 @@ extern int tolower(int c); # ifdef WOLFBOOT_SIGN_ECC256 # define HAVE_ECC256 # define FP_MAX_BITS (256 + 32) +# if !defined(USE_FAST_MATH) && !defined(WOLFSSL_SP_MATH_ALL) +# define WOLFSSL_SP_NO_384 +# define WOLFSSL_SP_NO_521 +# endif # elif defined(WOLFBOOT_SIGN_ECC384) # define HAVE_ECC384 # define FP_MAX_BITS (384 * 2) diff --git a/tools/test.mk b/tools/test.mk index df84bf521..632473cd0 100644 --- a/tools/test.mk +++ b/tools/test.mk @@ -74,6 +74,7 @@ $(BINASSEMBLE): test-size: FORCE $(Q)make clean $(Q)make wolfboot.bin + $(Q)$(CROSS_COMPILE)strip wolfboot.elf $(Q)FP=`$(SIZE) -A wolfboot.elf | awk ' /Total/ {print $$2;}'`; echo SIZE: $$FP LIMIT: $$LIMIT; test $$FP -le $$LIMIT # Testbed actions @@ -949,7 +950,7 @@ test-size-all: make keysclean make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13706 make keysclean - make test-size SIGN=RSA2048 LIMIT=11186 + make test-size SIGN=RSA2048 LIMIT=11226 make keysclean make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11166 make keysclean