From b1b6ea5b78c2e38cf43c3fb4a4531625d7352df0 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 20 May 2019 17:03:57 -0400 Subject: [PATCH] Fold declarations for CRYPTOGAMS_armcaps Also declare storage for CRYPTOGAMS_armcaps. This moves the symbol from BSS to initialized data. The Cryptogams module declares the symbol as common, so they are weak and use our declaration. --- sha.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sha.cpp b/sha.cpp index 587405b5..4f465532 100644 --- a/sha.cpp +++ b/sha.cpp @@ -59,6 +59,11 @@ # undef CRYPTOPP_SSE2_ASM_AVAILABLE #endif +#if CRYPTOGAMS_ARM_SHA1 || CRYPTOGAMS_ARM_SHA256 || CRYPTOGAMS_ARM_SHA512 +extern "C" unsigned int CRYPTOGAMS_armcaps; +unsigned int CRYPTOGAMS_armcaps = 0; +#endif + NAMESPACE_BEGIN(CryptoPP) #if CRYPTOPP_SHANI_AVAILABLE @@ -67,7 +72,6 @@ extern void SHA256_HashMultipleBlocks_SHANI(word32 *state, const word32 *data, s #endif #if CRYPTOGAMS_ARM_SHA1 -extern "C" unsigned int CRYPTOGAMS_armcaps; extern "C" int sha1_block_data_order(word32* state, const word32 *data, size_t blocks); #endif @@ -80,7 +84,6 @@ extern void SHA256_HashMultipleBlocks_ARMV8(word32 *state, const word32 *data, s #endif #if CRYPTOGAMS_ARM_SHA256 -extern "C" unsigned int CRYPTOGAMS_armcaps; extern "C" int sha256_block_data_order(word32* state, const word32 *data, size_t blocks); #endif @@ -94,7 +97,6 @@ extern void SHA512_HashMultipleBlocks_POWER8(word64 *state, const word64 *data, #endif #if CRYPTOGAMS_ARM_SHA512 -extern "C" unsigned int CRYPTOGAMS_armcaps; extern "C" int sha512_block_data_order(word64* state, const word64 *data, size_t blocks); #endif