diff options
author | Liming Gao <liming.gao@intel.com> | 2019-10-17 14:55:53 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-10-24 09:41:34 +0800 |
commit | 933681b2084435ec2744e7042e3864cabd4fa879 (patch) | |
tree | 72763803f6ca25db9f629ffbd70d20d132272595 /CryptoPkg | |
parent | 3d61650f95193694fb00e1e6863ef09c5ecba090 (diff) | |
download | edk2-933681b2084435ec2744e7042e3864cabd4fa879.tar.gz edk2-933681b2084435ec2744e7042e3864cabd4fa879.tar.bz2 edk2-933681b2084435ec2744e7042e3864cabd4fa879.zip |
CryptoPkg IntrinsicLib: Make _fltused always be used
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603
With this change, global variable _fltused will not be removed by LTO
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Diffstat (limited to 'CryptoPkg')
-rw-r--r-- | CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 10 |
1 files 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.<BR>
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>
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)
|