Re: [edk2] [PATCH v2] BaseTools IA32/X64: prevent .eh_frame sections from being generated

2015-08-13 Thread Ard Biesheuvel
On 13 August 2015 at 07:44, Gao, Liming liming@intel.com wrote:
 Reviewed-by: Liming Gao liming@intel.com


Thanks

Committed as SVN r18217

-- 
Ard.

 -Original Message-
 From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
 Sent: Thursday, August 13, 2015 1:19 PM
 To: edk2-devel@lists.01.org; ler...@redhat.com; Liu, Yingke D
 Cc: Gao, Liming; Ard Biesheuvel
 Subject: [PATCH v2] BaseTools IA32/X64: prevent .eh_frame sections from being 
 generated

 After the recent GNU linker script changes, the following warning is emitted 
 many times during the OVMF build:

 BFD: ...: warning: Empty loadable segment detected, is this intentional ?

 This is caused by the fact that, now that the section layout has changed 
 somewhat, the .eh_frame section is assigned an ELF segment of its own, which 
 ends up with no contents at all after we strip the .eh_frame section from the 
 output. (Note that the program headers that contain the segment information 
 are completely irrelevant to us since the PE/COFF conversion does not rely on 
 them.)

 Since we only retain the .eh_frame data for external debugging, and not for 
 things like stack unwinding or generating backtraces at runtime, we can 
 remedy the situation by passing -fno-asynchronous-unwind-tables on the GCC 
 command line. This option instructs the compiler to emit the unwind data into 
 a debug section called .debug_frame instead of into .eh_frame.

 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
 Reviewed-by: Laszlo Ersek ler...@redhat.com
 Build-tested-by: Laszlo Ersek ler...@redhat.com
 ---
 v2: give IA32 the same treatment as X86
 add Laszlo's acks
 ---
  BaseTools/Conf/tools_def.template | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/BaseTools/Conf/tools_def.template 
 b/BaseTools/Conf/tools_def.template
 index 6e2d4909b9fc..859fbe14ad59 100644
 --- a/BaseTools/Conf/tools_def.template
 +++ b/BaseTools/Conf/tools_def.template
 @@ -3839,8 +3839,8 @@ DEFINE GCC_ARM_RC_FLAGS= -I binary -O 
 elf32-littlearm -B arm
  DEFINE GCC_AARCH64_RC_FLAGS= -I binary -O elf64-littleaarch64 -B 
 aarch64 --rename-section .data=.hii

  DEFINE GCC44_ALL_CC_FLAGS= -g -fshort-wchar -fno-strict-aliasing 
 -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c 
 -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
 -DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
 -malign-double -fno-stack-protector -D EFI32
 -DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
 -fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
 -mno-red-zone -Wno-address -mcmodel=large
 +DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
 +DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
 -fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
 -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables
  DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections -z 
 common-page-size=0x20
  DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) 
 --entry ReferenceAcpiTable -u ReferenceAcpiTable
  DEFINE GCC44_IA32_X64_DLINK_FLAGS= DEF(GCC44_IA32_X64_DLINK_COMMON) 
 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map 
 $(DEST_DIR_DEBUG)/$(BASE_NAME).map
 --
 1.9.1

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


Re: [edk2] [PATCH v2] BaseTools IA32/X64: prevent .eh_frame sections from being generated

2015-08-12 Thread Gao, Liming
Reviewed-by: Liming Gao liming@intel.com

-Original Message-
From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
Sent: Thursday, August 13, 2015 1:19 PM
To: edk2-devel@lists.01.org; ler...@redhat.com; Liu, Yingke D
Cc: Gao, Liming; Ard Biesheuvel
Subject: [PATCH v2] BaseTools IA32/X64: prevent .eh_frame sections from being 
generated

After the recent GNU linker script changes, the following warning is emitted 
many times during the OVMF build:

BFD: ...: warning: Empty loadable segment detected, is this intentional ?

This is caused by the fact that, now that the section layout has changed 
somewhat, the .eh_frame section is assigned an ELF segment of its own, which 
ends up with no contents at all after we strip the .eh_frame section from the 
output. (Note that the program headers that contain the segment information are 
completely irrelevant to us since the PE/COFF conversion does not rely on them.)

Since we only retain the .eh_frame data for external debugging, and not for 
things like stack unwinding or generating backtraces at runtime, we can remedy 
the situation by passing -fno-asynchronous-unwind-tables on the GCC command 
line. This option instructs the compiler to emit the unwind data into a debug 
section called .debug_frame instead of into .eh_frame.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
Reviewed-by: Laszlo Ersek ler...@redhat.com
Build-tested-by: Laszlo Ersek ler...@redhat.com
---
v2: give IA32 the same treatment as X86
add Laszlo's acks
---
 BaseTools/Conf/tools_def.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 6e2d4909b9fc..859fbe14ad59 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -3839,8 +3839,8 @@ DEFINE GCC_ARM_RC_FLAGS= -I binary -O 
elf32-littlearm -B arm
 DEFINE GCC_AARCH64_RC_FLAGS= -I binary -O elf64-littleaarch64 -B 
aarch64 --rename-section .data=.hii
 
 DEFINE GCC44_ALL_CC_FLAGS= -g -fshort-wchar -fno-strict-aliasing 
-Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include 
AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
-malign-double -fno-stack-protector -D EFI32
-DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
-fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
-mno-red-zone -Wno-address -mcmodel=large
+DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
-malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
+DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
-fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
-mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables
 DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections -z 
common-page-size=0x20
 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry ReferenceAcpiTable -u ReferenceAcpiTable
 DEFINE GCC44_IA32_X64_DLINK_FLAGS= DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map 
$(DEST_DIR_DEBUG)/$(BASE_NAME).map
--
1.9.1

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


[edk2] [PATCH v2] BaseTools IA32/X64: prevent .eh_frame sections from being generated

2015-08-12 Thread Ard Biesheuvel
After the recent GNU linker script changes, the following warning is
emitted many times during the OVMF build:

BFD: ...: warning: Empty loadable segment detected, is this intentional ?

This is caused by the fact that, now that the section layout has changed
somewhat, the .eh_frame section is assigned an ELF segment of its own,
which ends up with no contents at all after we strip the .eh_frame
section from the output. (Note that the program headers that contain the
segment information are completely irrelevant to us since the PE/COFF
conversion does not rely on them.)

Since we only retain the .eh_frame data for external debugging, and not
for things like stack unwinding or generating backtraces at runtime, we
can remedy the situation by passing -fno-asynchronous-unwind-tables on
the GCC command line. This option instructs the compiler to emit the
unwind data into a debug section called .debug_frame instead of into
.eh_frame.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
Reviewed-by: Laszlo Ersek ler...@redhat.com
Build-tested-by: Laszlo Ersek ler...@redhat.com
---
v2: give IA32 the same treatment as X86
add Laszlo's acks
---
 BaseTools/Conf/tools_def.template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index 6e2d4909b9fc..859fbe14ad59 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -3839,8 +3839,8 @@ DEFINE GCC_ARM_RC_FLAGS= -I binary -O 
elf32-littlearm -B arm
 DEFINE GCC_AARCH64_RC_FLAGS= -I binary -O elf64-littleaarch64 -B 
aarch64 --rename-section .data=.hii
 
 DEFINE GCC44_ALL_CC_FLAGS= -g -fshort-wchar -fno-strict-aliasing 
-Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include 
AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
-malign-double -fno-stack-protector -D EFI32
-DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
-fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
-mno-red-zone -Wno-address -mcmodel=large
+DEFINE GCC44_IA32_CC_FLAGS   = DEF(GCC44_ALL_CC_FLAGS) -m32 
-malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
+DEFINE GCC44_X64_CC_FLAGS= DEF(GCC44_ALL_CC_FLAGS) -m64 
-fno-stack-protector -DEFIAPI=__attribute__((ms_abi)) -DNO_BUILTIN_VA_FUNCS 
-mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables
 DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections -z 
common-page-size=0x20
 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry ReferenceAcpiTable -u ReferenceAcpiTable
 DEFINE GCC44_IA32_X64_DLINK_FLAGS= DEF(GCC44_IA32_X64_DLINK_COMMON) 
--entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map 
$(DEST_DIR_DEBUG)/$(BASE_NAME).map
-- 
1.9.1

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