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 13FEA1A1E43 for ; Mon, 1 Aug 2016 08:51:42 -0700 (PDT) Received: by mail-it0-x22c.google.com with SMTP id f6so174582255ith.0 for ; Mon, 01 Aug 2016 08:51:42 -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:content-transfer-encoding; bh=n4NkHDTOHwh95PZEiINoPguPkt+tU1Y1aB1VRQ7Bods=; b=TD72xBPFwluq6ZIlalftysV40oqK+LspLZpmlE0meXt4uQK0WFdc7n9cC/AYgovv6J sICwLEofKfX9Wv+hp4zeKpjaBmS1fT03DLDXwBTSlfraEMs1nbSAZm9+nd2yLCVnJm3G KJZ0fkv7dWVpePsCTzuyhzuj9g2cSKEZE/8YM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=n4NkHDTOHwh95PZEiINoPguPkt+tU1Y1aB1VRQ7Bods=; b=QJ/eVvM2U6MqLrv37seFH0a5fNro5DyeIcUdsKU/3KshYhHLFDbomQ5rPcCWcD3TyR h1vaP+TU7zyds9KUOEvOkwHIsKvmIM1eJPzi+YqmPL+cp+FCS27j+9i2ju9BXeHGY3u4 TvIn5YUYGw/Y/cTVh8K6P3QWdMjcKU10enH07hIqmv1+ktTr6E1wsPYalW02p6433em5 F61e2uQGkU73Cs3gretlJV1SRWXrcEMwILUrdjF9CAwpAtpCVw1+QWGgXsMZKwbbv/xr ok5ER2Od+JcQMUt5a8uru4e142O01ocTUhLWmfWUf3vrHdev1Z78gtsy10DN7lx3+Qce j7Xw== X-Gm-Message-State: AEkooutpT6aRTAQybJ8jzYE80GmxID96PjgGO2SLxhASfT80dk5GoDozni+FZPJDLeOrLt+n8njGDf7wlNV68fOq X-Received: by 10.36.57.215 with SMTP id l206mr15315803ita.5.1470066700419; Mon, 01 Aug 2016 08:51:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Mon, 1 Aug 2016 08:51:39 -0700 (PDT) In-Reply-To: References: <1470038497-2536-1-git-send-email-ard.biesheuvel@linaro.org> <1470038497-2536-8-git-send-email-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A1155E30DE@shsmsx102.ccr.corp.intel.com> From: Ard Biesheuvel Date: Mon, 1 Aug 2016 17:51:39 +0200 Message-ID: To: "Gao, Liming" Cc: "Shi, Steven" , "Zhu, Yonghong" , "Justen, Jordan L" , "edk2-devel@lists.01.org" , "lersek@redhat.com" , "leif.lindholm@linaro.org" Subject: Re: [PATCH v5 7/8] MdePkg GCC/X64: avoid 'hidden' visibility for module entry points X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 15:51:42 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 1 August 2016 at 16:56, Ard Biesheuvel wrote= : > On 1 August 2016 at 16:49, Ard Biesheuvel wro= te: >> On 1 August 2016 at 16:18, Gao, Liming wrote: >>> Ard: >>> I don't think it is good way to define GCC_VISIBILITY_PROTECTED and a= pply it in EntryPointLib. We only need to expose _ModuleEntryPoint. It has = been specified in LINK_FLAGS in tools_def.txt. Could we also specify its at= tribute in CC_FLAGS or LINK_FLAGS in tools_def.txt? >>> >> >> It seems this does the trick as well >> >> diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.l= ds >> index 281af8a9bd33..02387d4f8d6f 100644 >> --- a/BaseTools/Scripts/GccBase.lds >> +++ b/BaseTools/Scripts/GccBase.lds >> @@ -80,3 +80,7 @@ SECTIONS { >> *(COMMON) >> } >> } >> + >> +VERSION { >> + { global: _ModuleEntryPoint*; }; >> +}; >> >> >> Note that * at the end: this is necessary since _ModuleEntryPoint will >> be called _ModuleEntryPoint.lto_priv.xxx in the LTO objects. >> > > Hmm, looks like I spoke too soon. I don't know what I did wrong, but > this does not actually work. > The only alternative I can think of is to add a static non-lto object to the tree that refers to _ModuleEntryPoint, similar to the way I handle the ARM intrinsics in patch #5 Which one do you hate the least? :-)