From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AAC3A21A02918 for ; Thu, 25 May 2017 13:11:04 -0700 (PDT) Received: by mail-it0-x22c.google.com with SMTP id o5so62950915ith.1 for ; Thu, 25 May 2017 13:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=d5LBFUICu0MJS39CP/IlLrsLlLh3SVUttugEYtgyK0U=; b=VaTahwL9EA86QlqUkf+hY7fUFeDRriZaq3tMgE67ti2LzcSWIAEIcAvMV+mCvsYQR6 LrRGFqM529YMjK8Y9qRnc8oxEwHjh8y9oWVShNu4onOLX9UdKALhL9tmXyHTc8UOUtG/ 7qb0WY1sNqScVOg1zsRuOQBNs9eMB3LHi86gw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=d5LBFUICu0MJS39CP/IlLrsLlLh3SVUttugEYtgyK0U=; b=CZu4hJo2FFpF6vNUqtDJhbKD+DIsxnF+QV/Q8DiMQdw9g9kI+cB+NgbdzDn5Pi4WC7 LATGFB4OXPfD3L19Py4O2XIaYJuy8RrFrqjaxHzRA5OYvYdtMLWLijihJY3JNiAjZrrf 2HqkaJZPmMfNaQsxaM58JMURLh5v42Div4XXhT/gcl/5JWSEGUvwu2uuavQYj5j0fRQR nSmKWbOT7Eh5ApdDIpbpynZeyXwHczpIpgdOSZkZwPnzf0vT35ROTiS63QDGqJdtbcoW DbQ5xLT0bQ7kJnw/zxn0OIwAam2rRf0XP8EFeRC7HiyDiDlOSh0gSFZJJiI55KEdsjbE /RKg== X-Gm-Message-State: AODbwcD/pstYzHWU9FTpronyKYgFAFtp2WdLGXSp2X0Elt+t7rRuUYTn gs53ocQHL5evuVzMqYEYcx5rgmf8hUqg X-Received: by 10.36.24.4 with SMTP id 4mr1236108itr.6.1495743064097; Thu, 25 May 2017 13:11:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.24 with HTTP; Thu, 25 May 2017 13:11:03 -0700 (PDT) In-Reply-To: References: <1495581673-10788-1-git-send-email-michael.d.kinney@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4C5E94B8@shsmsx102.ccr.corp.intel.com> From: Ard Biesheuvel Date: Thu, 25 May 2017 13:11:03 -0700 Message-ID: To: "Kinney, Michael D" , Felix Poludov Cc: "Fan, Jeff" , "edk2-devel@lists.01.org" , "Wu, Hao A" , Laszlo Ersek , Andrew Fish 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:11:04 -0000 Content-Type: text/plain; charset="UTF-8" On 25 May 2017 at 13:06, Kinney, Michael D wrote: > 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. > GLOBAL_REMOVE_IF_UNREFERENCED itself is problematic imo. I think it was Felix who reported on this recently? STATIC is really the only sensible way to deal with this for symbols that are only referenced by a single compilation unit. > 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 > library instance that is exporting more than the library class. > A static library is nothing more than an archive containing a collection of object files. Sadly, that implies that we cannot distinguish between symbols that may only be referenced by other objects in the same static library and symbols that are exported to the library client.