From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 716F921A02912 for ; Thu, 25 May 2017 13:06:46 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2017 13:06:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,393,1491289200"; d="scan'208";a="1134774526" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga001.jf.intel.com with ESMTP; 25 May 2017 13:06:45 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 May 2017 13:06:45 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.59]) by ORSMSX162.amr.corp.intel.com ([169.254.3.200]) with mapi id 14.03.0319.002; Thu, 25 May 2017 13:06:45 -0700 From: "Kinney, Michael D" To: "Fan, Jeff" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Wu, Hao A" , Laszlo Ersek , Andrew Fish Thread-Topic: [edk2] [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol Thread-Index: AQHS1BtKrH1XaxmZJEaVg215IKXpe6IDPWgAgAI9aZA= Date: Thu, 25 May 2017 20:06:44 +0000 Message-ID: References: <1495581673-10788-1-git-send-email-michael.d.kinney@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4C5E94B8@shsmsx102.ccr.corp.intel.com> In-Reply-To: <542CF652F8836A4AB8DBFAAD40ED192A4C5E94B8@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWMwMmI0ZmUtNjc4OC00NTBlLTk4MjUtYWFjOTBhZmIwM2RlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjBHXC9UTkxhSzVqK0VFMVpXYmIybUZHSzQrNGJGVW9tUENsSkhpQXZTYkNvPSJ9 dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 May 2017 20:06:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Laszlo and Andrew, With the information that has been collected on this thread, I still think this patch in its original form is a good change to resolve the this one specific duplicate symbol issue for all tool chains. 'static' can not be mixed with GLOBAL_REMOVE_IF_UNREFERENCED for MSFT tool chains, so renaming the global variable is the easiest way to remove the duplicate. I will continue to work on ways to detect duplicate symbols for all tool chains and will enter a Bugzilla issue to for that feature. In addition, the idea of detecting if a library is exporting more than the library class defines is another good feature to consider and I will enter a Bugzilla issue for that one as well. If we can find ways to both restrict the symbols exported by a library and strip all symbols that are unused, then we can have additional Bugzilla issues to perform that clean up on each=20 library instance that is exporting more than the library class. Thanks, Mike > -----Original Message----- > From: Fan, Jeff > Sent: Tuesday, May 23, 2017 7:48 PM > To: Kinney, Michael D ; edk2-devel@lists.01.o= rg > Cc: Wu, Hao A ; Kinney, Michael D > ; Laszlo Ersek ; Andrew Fi= sh > > Subject: RE: [edk2] [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix > duplicate symbol >=20 > Reviewed-by: Jeff Fan >=20 > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Mi= chael > Kinney > Sent: Wednesday, May 24, 2017 7:21 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A; Kinney, Michael D; Laszlo Ersek; Andrew Fish; Fan, Jeff > Subject: [edk2] [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix dupl= icate > symbol >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D573 >=20 > The SecPeiDebugAgentLib uses the global variable mMemoryDiscoveredNotifyL= ist for > a PPI notification on the Memory Discovered PPI. This same variable name= is used > in the DxeIplPeim for the same PPI notification. >=20 > The XCODE5 tool chain detects this duplicate symbol when the OVMF platfor= m is > built with the flag -D SOURCE_DEBUG_ENABLE. >=20 > The fix is to rename this global variable in the SecPeiDebugAgentLib libr= ary. >=20 > Cc: Andrew Fish > Cc: Jeff Fan > Cc: Hao Wu > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Michael D Kinney > --- > .../Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c | = 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git > a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgen= tLib.c > b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgen= tLib.c > index b717e33..9f5223a 100644 > --- > a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgen= tLib.c > +++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebu > +++ gAgentLib.c > @@ -32,7 +32,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR > mVectorHandoffInf > } > }; >=20 > -GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR > mMemoryDiscoveredNotifyList[1] =3D { > +GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR > +mDebugAgentMemoryDiscoveredNotifyList[1] =3D { > { > (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), > &gEfiPeiMemoryDiscoveredPpiGuid, > @@ -554,7 +554,7 @@ InitializeDebugAgent ( > // Register for a callback once memory has been initialized. > // If memery has been ready, the callback funtion will be invoked > immediately > // > - Status =3D PeiServicesNotifyPpi (&mMemoryDiscoveredNotifyList[0]); > + Status =3D PeiServicesNotifyPpi > + (&mDebugAgentMemoryDiscoveredNotifyList[0]); > if (EFI_ERROR (Status)) { > DEBUG ((EFI_D_ERROR, "DebugAgent: Failed to register memory discov= ered > callback function!\n")); > CpuDeadLoop (); > -- > 2.6.3.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel