From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web11.1558.1571131860014434156 for ; Tue, 15 Oct 2019 02:31:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GiVJlymv; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571131859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L6g5fZbF83Q592d7BBfKCLRhSHKH/hHrfkxFh9qAAYk=; b=GiVJlymvHLm8UnmLdZ1YY86yyr+jtyJO7eXnJLHfTp76PKIquUJDH3HLaRDMSIBDRJb9vV AjPFDLBSuvagfnw14kjJCjPErOHoL9lWmSqjdpaEwT5+ZeMyceod2NxtoW/9q+yGXWWHvM HZfmRvOCRuUlHfntMZ3p0qm1F8psZEw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-EQq6CCTZOi6BlT4nyPsWXg-1; Tue, 15 Oct 2019 05:30:57 -0400 Received: by mail-wr1-f72.google.com with SMTP id w10so9851299wrl.5 for ; Tue, 15 Oct 2019 02:30:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=z8RuF5aflftQDatl+p/xXiaIb1XOP/TViCX3gp+kXUo=; b=MY0lUE7nhCx2zCp0KIxMPmF4Ze/mhLey9cBS+KbX9gF1/BW+oKM0tJTHfU0L0CFzPV FkwLE2e0Ld/UT9BcapbmpsWxvtacfYjS3GOxFsoHCIPmzaYYwOAxbN2PUafsPu00DJSK AP2bwpQnE2/JN/Ag/l/pedbChvdWL+SpkmAGNCGSZ2UXXMLkOiabGq9MvdRH419gs4J8 bypokJB9ce2HdeaWy8aVmxrEdaC9r36+BOXa7fgkr8p/thQDd7MyG5GiDhNFrJnaxQ53 d5p7XT2rXAcL1/3jQOKCp97RcDIlvpwE1+OMp24aJAvTMr2jWZG4g3lueeTyf81wqWG2 cuSQ== X-Gm-Message-State: APjAAAWt2Tv8Omm0eBrie8377jntuhKheTkqhoKcU95XODM/Z65wi1h8 fhjnGFm/iQaAwDuo/qXqcq2BxqOstvUEhQj0Vv8y7fKrMsdULKtWpM4ElLJ2yXGa5umScKoZFmN 1jla2Lj22n0Ep5Q== X-Received: by 2002:a1c:5409:: with SMTP id i9mr18953987wmb.120.1571131855952; Tue, 15 Oct 2019 02:30:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx86KsczbCibVTGixy5+dk75XqhpwFl/Kltp3/h5b1xous4Qpy2GWIfle9Kh/KCVVfpdLZOYg== X-Received: by 2002:a1c:5409:: with SMTP id i9mr18953965wmb.120.1571131855713; Tue, 15 Oct 2019 02:30:55 -0700 (PDT) Return-Path: Received: from [192.168.1.36] (14.red-88-21-201.staticip.rima-tde.net. [88.21.201.14]) by smtp.gmail.com with ESMTPSA id o18sm52182477wrw.90.2019.10.15.02.30.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Oct 2019 02:30:55 -0700 (PDT) Subject: Re: [edk2-devel] [Patch v2 09/11] CryptoPkg IntrinsicLib: Make _fltused always be used To: devel@edk2.groups.io, liming.gao@intel.com References: <1571099210-12432-1-git-send-email-liming.gao@intel.com> <1571099210-12432-10-git-send-email-liming.gao@intel.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <1fae8619-345f-bf4b-2667-3bdd6a4eea13@redhat.com> Date: Tue, 15 Oct 2019 11:30:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <1571099210-12432-10-git-send-email-liming.gao@intel.com> X-MC-Unique: EQq6CCTZOi6BlT4nyPsWXg-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 10/15/19 2:26 AM, Liming Gao wrote: > 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/CryptoPk= g/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) >=20 Reviewed-by: Philippe Mathieu-Daude