From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jiewen.yao@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Fri, 27 Sep 2019 01:34:22 -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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 01:34:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,554,1559545200"; d="scan'208";a="389895231" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 27 Sep 2019 01:34:21 -0700 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Sep 2019 01:34:21 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 27 Sep 2019 01:34:20 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.235]) with mapi id 14.03.0439.000; Fri, 27 Sep 2019 16:34:18 +0800 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Gao, Liming" Subject: Re: [edk2-devel] [Patch 09/12] CryptoPkg IntrinsicLib: Make _fltused always be used Thread-Topic: [edk2-devel] [Patch 09/12] CryptoPkg IntrinsicLib: Make _fltused always be used Thread-Index: AQHVdQfVy5TMWOV6iEGdHaD7PcPQIac/Mo5Q Date: Fri, 27 Sep 2019 08:34:18 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F7CCA59@shsmsx102.ccr.corp.intel.com> References: <1569570395-11240-1-git-send-email-liming.gao@intel.com> <1569570395-11240-10-git-send-email-liming.gao@intel.com> In-Reply-To: <1569570395-11240-10-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmY0ODU2M2YtMDIwZS00MGYxLWJhYjUtMzg3YzY2ZTkyNDU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTDFPYjdSOVlTT1dkcXppNVNXMTlkWmVaWXpYVjNoVGNwOHpwandKSGtkUVdlNkgxKzI1ZUx2S0NTcVFyblBMdCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi +int GLOBAL_USED _fltused =3D 1; May I know what is the use of GLOBAL_USED? Only for compiler stub symbol? If so, why we add __GNUC__ here? Any other usage? +#if defined(__GNUC__) || defined(__clang__) + #define GLOBAL_USED __attribute__((used)) +#else + #define GLOBAL_USED +#endif > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Liming Ga= o > Sent: Friday, September 27, 2019 3:47 PM > To: devel@edk2.groups.io > Subject: [edk2-devel] [Patch 09/12] CryptoPkg IntrinsicLib: Make _fltuse= d always > be used >=20 > With this change, global variable _fltused will not be removed by LTO >=20 > Signed-off-by: Liming Gao > --- > CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > 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. >=20 > -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 >=20 > **/ > @@ -13,9 +13,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > typedef UINTN size_t; >=20 > +#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 lin= ker. */ > -int _fltused =3D 1; > +int GLOBAL_USED _fltused =3D 1; >=20 > /* Sets buffers to a specified character */ > void * memset (void *dest, int ch, size_t count) > -- > 2.13.0.windows.1 >=20 >=20 >=20