From 10d5cfe461fe2ef927b5aa0dd34aa39a3d913f3c Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Tue, 20 Sep 2016 13:58:53 -0700 Subject: [PATCH] bdb: Define RSA symbols non-weakly Defining these symbols weakly causes the output executable to hit segmentation fault because ld chooses *UND* symbols over the definition when they appear in *.a archive: $ objdump -t build/libvboot_utilbdb.a bdb.o: 0000000000000000 w *UND* 0000000000000000 bdb_rsa4096_verify ... rsa.o 000000000000061f w F .text 0000000000000111 bdb_rsa4096_verify ... This happens regardless whether the symbol is referenced or not; or whether the object defining the symbol appears earlier than the reference or not. BUG=none BRANCH=none TEST=make runtests Change-Id: Ib53a9010f2afdc2ba59369fb145aef4381db30d3 Signed-off-by: Daisuke Nojiri Reviewed-on: https://chromium-review.googlesource.com/387905 Reviewed-by: Randall Spangler --- Makefile | 1 + firmware/bdb/bdb.h | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 15c81d0331..08e07367c5 100644 --- a/Makefile +++ b/Makefile @@ -377,6 +377,7 @@ FWLIB21_SRCS = \ BDBLIB_SRCS = \ firmware/bdb/bdb.c \ + firmware/bdb/ecdsa.c \ firmware/bdb/misc.c \ firmware/bdb/rsa.c \ firmware/bdb/secrets.c \ diff --git a/firmware/bdb/bdb.h b/firmware/bdb/bdb.h index bf421afb92..ef10a19d69 100644 --- a/firmware/bdb/bdb.h +++ b/firmware/bdb/bdb.h @@ -163,7 +163,6 @@ const struct bdb_sig *bdb_get_data_sig(const void *buf); * @param size Size of data in bytes * @return 0 if success, non-zero error code if error. */ -__attribute__((weak)) int bdb_sha256(void *digest, const void *buf, size_t size); /** @@ -174,7 +173,6 @@ int bdb_sha256(void *digest, const void *buf, size_t size); * @param digest Digest of signed data (BDB_SHA256_DIGEST bytes) * @return 0 if success, non-zero error code if error. */ -__attribute__((weak)) int bdb_rsa4096_verify(const uint8_t *key_data, const uint8_t *sig, const uint8_t *digest); @@ -187,7 +185,6 @@ int bdb_rsa4096_verify(const uint8_t *key_data, * @param digest Digest of signed data (BDB_SHA256_DIGEST bytes) * @return 0 if success, non-zero error code if error. */ -__attribute__((weak)) int bdb_rsa3072b_verify(const uint8_t *key_data, const uint8_t *sig, const uint8_t *digest); @@ -200,7 +197,6 @@ int bdb_rsa3072b_verify(const uint8_t *key_data, * @param digest Digest of signed data (BDB_SHA256_DIGEST bytes) * @return 0 if success, non-zero error code if error. */ -__attribute__((weak)) int bdb_ecdsa521_verify(const uint8_t *key_data, const uint8_t *sig, const uint8_t *digest);