回复: [edk2-devel] [PATCH v7 1/3] BaseTools: Remove COMMON section from the GCC discard list

gaoliming gaoliming at byosoft.com.cn
Thu Aug 5 05:04:09 UTC 2021


Ard:
  Chris explains this change in https://edk2.groups.io/g/devel/message/77662. And, he also verifies the patch in OVMF with GCC5 tool chain. 

Thanks
Liming
> -----邮件原件-----
> 发件人: Ard Biesheuvel <ardb at kernel.org>
> 发送时间: 2021年8月4日 20:27
> 收件人: Yao, Jiewen <jiewen.yao at intel.com>
> 抄送: devel at edk2.groups.io; christopher.zurcher at outlook.com; Feng, Bob C
> <bob.c.feng at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>
> 主题: Re: [edk2-devel] [PATCH v7 1/3] BaseTools: Remove COMMON section
> from the GCC discard list
> 
> On Wed, 21 Jul 2021 at 13:44, Yao, Jiewen <jiewen.yao at intel.com> wrote:
> >
> > Acked-by: Jiewen Yao <Jiewen.yao at intel.com>
> >
> 
> I don't think this is a good idea tbh. We have already identified that
> EDK2 code often fails to use the STATIC keyword when possible for
> global variables, and that unrelated variables that happen to have the
> same name will be collapsed into the same storage unit in the program
> image. (see commit 214a3b79417f64bf2faae74af42c1b9d23f50dc8 for
> details)
> 
> Was this considered? Is this no longer an issue?
> 
> 
> 
> > > -----Original Message-----
> > > From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of
> Christopher
> > > Zurcher
> > > Sent: Wednesday, July 21, 2021 6:07 AM
> > > To: devel at edk2.groups.io
> > > Cc: Ard Biesheuvel <ardb at kernel.org>; Feng, Bob C
> <bob.c.feng at intel.com>;
> > > Liming Gao <gaoliming at byosoft.com.cn>
> > > Subject: [edk2-devel] [PATCH v7 1/3] BaseTools: Remove COMMON
> section
> > > from the GCC discard list
> > >
> > > From: Christopher Zurcher <christopher.zurcher at microsoft.com>
> > >
> > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2507
> > >
> > > The COMMON section is used by OpenSSL assembly-optimized crypto
> > > functions. OpenSSL assembly code is auto-generated from the submodule
> > > and cannot be modified to remove dependence on the COMMON section.
> > > The default -fno-common compiler flag should still prevent variable from
> > > being emitted into the COMMON section.
> > >
> > > Cc: Ard Biesheuvel <ardb at kernel.org>
> > > Cc: Bob Feng <bob.c.feng at intel.com>
> > > Cc: Liming Gao <gaoliming at byosoft.com.cn>
> > > Signed-off-by: Christopher Zurcher <christopher.zurcher at microsoft.com>
> > > ---
> > >  BaseTools/Scripts/GccBase.lds | 1 -
> > >  1 file changed, 1 deletion(-)
> > >
> > > diff --git a/BaseTools/Scripts/GccBase.lds
> b/BaseTools/Scripts/GccBase.lds
> > > index a9dd2138d4..83cebd29d5 100644
> > > --- a/BaseTools/Scripts/GccBase.lds
> > > +++ b/BaseTools/Scripts/GccBase.lds
> > > @@ -74,6 +74,5 @@ SECTIONS {
> > >      *(.dynamic)
> > >      *(.hash .gnu.hash)
> > >      *(.comment)
> > > -    *(COMMON)
> > >    }
> > >  }
> > > --
> > > 2.32.0.windows.1
> > >
> > >
> > >
> > > 
> > >
> >




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78699): https://edk2.groups.io/g/devel/message/78699
Mute This Topic: https://groups.io/mt/84678664/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list