From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: liming.gao@intel.com) Received: from mga03.intel.com (mga03.intel.com []) by groups.io with SMTP; Fri, 27 Sep 2019 00:47:19 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 00:47:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,554,1559545200"; d="scan'208";a="389884739" Received: from shwde7172.ccr.corp.intel.com ([10.239.158.22]) by fmsmga005.fm.intel.com with ESMTP; 27 Sep 2019 00:47:18 -0700 From: "Liming Gao" To: devel@edk2.groups.io Subject: [Patch 09/12] CryptoPkg IntrinsicLib: Make _fltused always be used Date: Fri, 27 Sep 2019 15:46:32 +0800 Message-Id: <1569570395-11240-10-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 In-Reply-To: <1569570395-11240-1-git-send-email-liming.gao@intel.com> References: <1569570395-11240-1-git-send-email-liming.gao@intel.com> With this change, global variable _fltused will not be removed by LTO Signed-off-by: Liming Gao --- CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c index 6e4d4a68cc..94fe341bec 100644 --- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c +++ b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c @@ -2,7 +2,7 @@ Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based Cryptographic Library. -Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -13,9 +13,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent typedef UINTN size_t; +#if defined(__GNUC__) || defined(__clang__) + #define GLOBAL_USED __attribute__((used)) +#else + #define GLOBAL_USED +#endif + /* OpenSSL will use floating point support, and C compiler produces the _fltused symbol by default. Simply define this symbol here to satisfy the linker. */ -int _fltused = 1; +int GLOBAL_USED _fltused = 1; /* Sets buffers to a specified character */ void * memset (void *dest, int ch, size_t count) -- 2.13.0.windows.1