Re: [edk2] [PATCH v3] [BaseTools/Scripts]: Preserve hii section in GCC binaries

2016-07-25 Thread Zhu, Yonghong
Pushed it 03630a81488ca30c384c09034caa1a70afb80a0d 

Best Regards,
Zhu Yonghong


-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: Friday, July 22, 2016 3:34 PM
To: Thomas Palmer ; edk2-de...@ml01.01.org
Cc: Zhu, Yonghong ; Gao, Liming ; 
af...@apple.com; joseph.shiffl...@hpe.com; Bruce Cran 
Subject: Re: [PATCH v3] [BaseTools/Scripts]: Preserve hii section in GCC 
binaries

On 07/22/16 04:56, Thomas Palmer wrote:
> According to UEFI spec:
> Once an image is loaded, LoadImage() installs 
> EFI_HII_PACKAGE_LIST_PROTOCOL on the handle if the image contains a 
> custom PE/COFF resource with the type 'HII'. The protocol's interface 
> pointer points to the HII package list which is contained in the 
> resource's data.
> 
> This is controlled by the UEFI_HII_RESOURCE_SECTION define in the INF 
> file.  When present the HII resource is linked with the module binary.
> 
> Unfortunately GCC-built binaries have been stripping the .hii section 
> entirely.  See  "[edk2] HII gEfiHiiPackageListProtocolGuid problem 
> with  GCC48(VS2012x86 works)"
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/13438
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/14899
> 
> This patch tells the linker to preserve the .hii sections
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Thomas Palmer 
> ---
>  BaseTools/Scripts/GccBase.lds | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/BaseTools/Scripts/GccBase.lds 
> b/BaseTools/Scripts/GccBase.lds index 32310bc..7e4cdde 100644
> --- a/BaseTools/Scripts/GccBase.lds
> +++ b/BaseTools/Scripts/GccBase.lds
> @@ -4,6 +4,7 @@
>  
>Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
>Copyright (c) 2015, Linaro Ltd. All rights reserved.
> +  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  
>This program and the accompanying materials are licensed and made 
> available under
>the terms and conditions of the BSD License that accompanies this 
> distribution.
> @@ -57,6 +58,10 @@ SECTIONS {
>  *(.rela .rela.*)
>}
>  
> +  .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {
> +KEEP (*(.hii))
> +  }
> +
>/DISCARD/ : {
>  *(.note.GNU-stack)
>  *(.gnu_debuglink)
> 

Acked-by: Laszlo Ersek 

Please also add the following tags from v2 when committing this patch, because 
the code has not changed, and the commit message changed only to add more 
information:

Reviewed-by: Bruce Cran 
Tested-by: Bruce Cran 

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3] [BaseTools/Scripts]: Preserve hii section in GCC binaries

2016-07-22 Thread Laszlo Ersek
On 07/22/16 04:56, Thomas Palmer wrote:
> According to UEFI spec:
> Once an image is loaded, LoadImage() installs
> EFI_HII_PACKAGE_LIST_PROTOCOL on the handle if the image contains a
> custom PE/COFF resource with the type 'HII'. The protocol's
> interface pointer points to the HII package list which is contained
> in the resource's data.
> 
> This is controlled by the UEFI_HII_RESOURCE_SECTION define in the INF
> file.  When present the HII resource is linked with the module
> binary.
> 
> Unfortunately GCC-built binaries have been stripping the .hii section
> entirely.  See  "[edk2] HII gEfiHiiPackageListProtocolGuid problem
> with  GCC48(VS2012x86 works)"
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/13438
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/14899
> 
> This patch tells the linker to preserve the .hii sections
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Thomas Palmer 
> ---
>  BaseTools/Scripts/GccBase.lds | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds
> index 32310bc..7e4cdde 100644
> --- a/BaseTools/Scripts/GccBase.lds
> +++ b/BaseTools/Scripts/GccBase.lds
> @@ -4,6 +4,7 @@
>  
>Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
>Copyright (c) 2015, Linaro Ltd. All rights reserved.
> +  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  
>This program and the accompanying materials are licensed and made 
> available under
>the terms and conditions of the BSD License that accompanies this 
> distribution.
> @@ -57,6 +58,10 @@ SECTIONS {
>  *(.rela .rela.*)
>}
>  
> +  .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {
> +KEEP (*(.hii))
> +  }
> +
>/DISCARD/ : {
>  *(.note.GNU-stack)
>  *(.gnu_debuglink)
> 

Acked-by: Laszlo Ersek 

Please also add the following tags from v2 when committing this patch,
because the code has not changed, and the commit message changed only to
add more information:

Reviewed-by: Bruce Cran 
Tested-by: Bruce Cran 

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3] [BaseTools/Scripts]: Preserve hii section in GCC binaries

2016-07-21 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Thomas Palmer
> Sent: Friday, July 22, 2016 10:57 AM
> To: edk2-devel@lists.01.org
> Cc: af...@apple.com; Gao, Liming ;
> ler...@redhat.com
> Subject: [edk2] [PATCH v3] [BaseTools/Scripts]: Preserve hii section in GCC
> binaries
> 
> According to UEFI spec:
> Once an image is loaded, LoadImage() installs
> EFI_HII_PACKAGE_LIST_PROTOCOL on the handle if the image contains a
> custom PE/COFF resource with the type 'HII'. The protocol's
> interface pointer points to the HII package list which is contained
> in the resource's data.
> 
> This is controlled by the UEFI_HII_RESOURCE_SECTION define in the INF
> file.  When present the HII resource is linked with the module
> binary.
> 
> Unfortunately GCC-built binaries have been stripping the .hii section
> entirely.  See  "[edk2] HII gEfiHiiPackageListProtocolGuid problem
> with  GCC48(VS2012x86 works)"
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/13438
> http://thread.gmane.org/gmane.comp.bios.tianocore.devel/14899
> 
> This patch tells the linker to preserve the .hii sections
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Thomas Palmer 
> ---
>  BaseTools/Scripts/GccBase.lds | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds
> index 32310bc..7e4cdde 100644
> --- a/BaseTools/Scripts/GccBase.lds
> +++ b/BaseTools/Scripts/GccBase.lds
> @@ -4,6 +4,7 @@
> 
>Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
>Copyright (c) 2015, Linaro Ltd. All rights reserved.
> +  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> 
>This program and the accompanying materials are licensed and made
> available under
>the terms and conditions of the BSD License that accompanies this
> distribution.
> @@ -57,6 +58,10 @@ SECTIONS {
>  *(.rela .rela.*)
>}
> 
> +  .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {
> +KEEP (*(.hii))
> +  }
> +
>/DISCARD/ : {
>  *(.note.GNU-stack)
>  *(.gnu_debuglink)
> --
> 1.9.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel