Skip to contentSkip to conversation

efi_loader: Generate Microsoft PE format compliant images

PATCH New Bin Meng 3 participants 22 messages Oct 2, 2018 – Oct 16, 2018

Subsystems (5)
Arm (32-bit) x86 Kbuild RISC-V +1 more subsystems
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2: None

 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.lib +1 -1
index 4dceb6d..a4f16bb 100644
@@ -381,7 +381,7 @@ $(obj)/%.efi: $(obj)/%_efi.so
 
 quiet_cmd_efi_ld = LD      $@
 cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
-		-Bsymbolic $^ -o $@
+		-Bsymbolic -s $^ -o $@
 
 EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 2/6 x86: efi: payload: Generate Microsoft PE format compliant image

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-payload.efi image in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2: None

 arch/x86/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/config.mk +1 -1
index cc94071..9ddf429 100644
@@ -33,7 +33,7 @@ PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)
 
 # This is used in the top-level Makefile which does not include
 # PLATFORM_LDFLAGS
-LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined
+LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -s
 
 OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
 	-j .rel -j .rela -j .reloc
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/6 x86: efi: payload: Generate Microsoft PE format compliant image

Quoted 5 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-payload.efi image in which these two members are not zero.

Quoted 7 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

#3 lore raw

PATCH v2 2/6 x86: efi: payload: Generate Microsoft PE format compliant image

In reply to Bin Meng
Quoted 5 lines

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-payload.efi image in which these two members are not zero.

Quoted 8 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Thanks, applied to efi-next

Alex

author
#4 lore raw

PATCH v2 3/6 x86: efi: app: Generate Microsoft PE format compliant image

In reply to Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-app.efi in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2: None

 arch/x86/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/config.mk +1 -1
index 9ddf429..68bec15 100644
@@ -64,7 +64,7 @@ CPPFLAGS_crt0-efi-$(EFIARCH).o += $(CFLAGS_EFI)
 ifeq ($(CONFIG_EFI_APP),y)
 
 PLATFORM_CPPFLAGS += $(CFLAGS_EFI)
-LDFLAGS_FINAL += -znocombreloc -shared
+LDFLAGS_FINAL += -znocombreloc -shared -s
 LDSCRIPT := $(LDSCRIPT_EFI)
 
 else
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 3/6 x86: efi: app: Generate Microsoft PE format compliant image

Quoted 11 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-app.efi in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

#6 lore raw

PATCH v2 3/6 x86: efi: app: Generate Microsoft PE format compliant image

In reply to Bin Meng
Quoted 5 lines

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating u-boot-app.efi in which these two members are not zero.

Quoted 7 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Thanks, applied to efi-next

Alex

author
#7 lore raw

PATCH v2 4/6 pe.h: Add characteristics defines

In reply to Bin Meng

This adds characteristics macros as defined by the Microsoft PE Format documentation [1].

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2:
- new patch to add characteristics defines in pe.h

 include/asm-generic/pe.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
include/asm-generic/pe.h +18 -0
index 9a8b5e8..faae534 100644
@@ -11,6 +11,24 @@
 #ifndef _ASM_PE_H
 #define _ASM_PE_H
 
+/* Characteristics */
+#define IMAGE_FILE_RELOCS_STRIPPED		0x0001
+#define IMAGE_FILE_EXECUTABLE_IMAGE		0x0002
+#define IMAGE_FILE_LINE_NUMS_STRIPPED		0x0004
+#define IMAGE_FILE_LOCAL_SYMS_STRIPPED		0x0008
+#define IMAGE_FILE_AGGRESSIVE_WS_TRIM		0x0010
+#define IMAGE_FILE_LARGE_ADDRESS_AWARE		0x0020
+/* Reserved					0x0040 */
+#define IMAGE_FILE_BYTES_REVERSED_LO		0x0080
+#define IMAGE_FILE_32BIT_MACHINE		0x0100
+#define IMAGE_FILE_DEBUG_STRIPPED		0x0200
+#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP	0x0400
+#define IMAGE_FILE_NET_RUN_FROM_SWAP		0x0800
+#define IMAGE_FILE_SYSTEM			0x1000
+#define IMAGE_FILE_DLL				0x2000
+#define IMAGE_FILE_UP_SYSTEM_ONLY		0x4000
+#define IMAGE_FILE_BYTES_REVERSED_HI		0x8000
+
 /* Subsystem type */
 #define IMAGE_SUBSYSTEM_EFI_APPLICATION		10
 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER	11
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH v2 5/6 arm: efi: Generate Microsoft PE format compliant images

In reply to Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on ARM and these two members are not zero.

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2:
- use macros in pe.h for the characteristics field

 arch/arm/lib/crt0_aarch64_efi.S | 12 ++++++------
 arch/arm/lib/crt0_arm_efi.S     | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)
arch/arm/lib/crt0_aarch64_efi.S +6 -6
index 0db4360..cb205fa 100644
@@ -28,13 +28,13 @@ coff_header:
 	.short	2				/* nr_sections */
 	.long	0				/* TimeDateStamp */
 	.long	0				/* PointerToSymbolTable */
-	.long	1				/* NumberOfSymbols */
+	.long	0				/* NumberOfSymbols */
 	.short	section_table - optional_header	/* SizeOfOptionalHeader */
-	/*
-	 * Characteristics: IMAGE_FILE_DEBUG_STRIPPED |
-	 * IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LINE_NUMS_STRIPPED
-	 */
-	.short	0x206
+	/* Characteristics */
+	.short	(IMAGE_FILE_EXECUTABLE_IMAGE | \
+		 IMAGE_FILE_LINE_NUMS_STRIPPED | \
+		 IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+		 IMAGE_FILE_DEBUG_STRIPPED)
 optional_header:
 	.short	0x20b				/* PE32+ format */
 	.byte	0x02				/* MajorLinkerVersion */
arch/arm/lib/crt0_arm_efi.S +8 -8
index 23db49f..5470e2f 100644
@@ -27,16 +27,16 @@ coff_header:
 	.short	2				/* nr_sections */
 	.long	0				/* TimeDateStamp */
 	.long	0				/* PointerToSymbolTable */
-	.long	1				/* NumberOfSymbols */
+	.long	0				/* NumberOfSymbols */
 	.short	section_table - optional_header	/* SizeOfOptionalHeader */
-	/*
-	 * Characteristics: IMAGE_FILE_32BIT_MACHINE |
-	 * IMAGE_FILE_DEBUG_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE |
-	 * IMAGE_FILE_LINE_NUMS_STRIPPED
-	 */
-	.short	0x306
+	/* Characteristics */
+	.short	(IMAGE_FILE_EXECUTABLE_IMAGE | \
+		 IMAGE_FILE_LINE_NUMS_STRIPPED | \
+		 IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+		 IMAGE_FILE_32BIT_MACHINE | \
+		 IMAGE_FILE_DEBUG_STRIPPED)
 optional_header:
-	.short	0x10b				/* PE32+ format */
+	.short	0x10b				/* PE32 format */
 	.byte	0x02				/* MajorLinkerVersion */
 	.byte	0x14				/* MinorLinkerVersion */
 	.long	_edata - _start			/* SizeOfCode */
Signature · 1 line
2.7.4
#11 lore raw

PATCH v2 5/6 arm: efi: Generate Microsoft PE format compliant images

Quoted 5 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on ARM and these two members are not zero.

Quoted 7 lines

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Quoted 9 lines

---

Changes in v2:
- use macros in pe.h for the characteristics field

 arch/arm/lib/crt0_aarch64_efi.S | 12 ++++++------
 arch/arm/lib/crt0_arm_efi.S     | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)
#12 lore raw

PATCH v2 5/6 arm: efi: Generate Microsoft PE format compliant images

In reply to Bin Meng
Quoted 5 lines

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on ARM and these two members are not zero.

Quoted 8 lines

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Thanks, applied to efi-next

Alex

author
#13 lore raw

PATCH v2 6/6 riscv: efi: Generate Microsoft PE format compliant images

In reply to Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on RISC-V and these two members are not zero.

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2:
- use macros in pe.h for the characteristics field

 arch/riscv/lib/crt0_riscv_efi.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/riscv/lib/crt0_riscv_efi.S +6 -6
index 18f61f5..b7b5329 100644
@@ -41,13 +41,13 @@ coff_header:
 	.short	2				/* nr_sections */
 	.long	0				/* TimeDateStamp */
 	.long	0				/* PointerToSymbolTable */
-	.long	1				/* NumberOfSymbols */
+	.long	0				/* NumberOfSymbols */
 	.short	section_table - optional_header	/* SizeOfOptionalHeader */
-	/*
-	 * Characteristics: IMAGE_FILE_DEBUG_STRIPPED |
-	 * IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LINE_NUMS_STRIPPED
-	 */
-	.short	0x206
+	/* Characteristics */
+	.short	(IMAGE_FILE_EXECUTABLE_IMAGE | \
+		 IMAGE_FILE_LINE_NUMS_STRIPPED | \
+		 IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+		 IMAGE_FILE_DEBUG_STRIPPED)
 optional_header:
 	.short	0x20b				/* PE32+ format */
 	.byte	0x02				/* MajorLinkerVersion */
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 6/6 riscv: efi: Generate Microsoft PE format compliant images

Quoted 26 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on RISC-V and these two members are not zero.

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2:
- use macros in pe.h for the characteristics field

 arch/riscv/lib/crt0_riscv_efi.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/riscv/lib/crt0_riscv_efi.S +0 -0
index 18f61f5..b7b5329 100644

arch/riscv/lib/crt0_riscv_efi.S coff_header: · line 44

Quoted 5 lines
arch/riscv/lib/crt0_riscv_efi.S +1 -1
@@ -41,13 +41,13 @@ coff_header:
 	.short	2				/* nr_sections */
 	.long	0				/* TimeDateStamp */
 	.long	0				/* PointerToSymbolTable */
-	.long	1				/* NumberOfSymbols */
+	.long	0				/* NumberOfSymbols */

Looking at the top of the file it is meant both for 32bit and for 64bit systems:

#if __riscv_xlen == 64
#define SIZE_LONG 8

#define SAVE_LONG(reg, idx)     sd      reg, (idx*SIZE_LONG)(sp)
#define LOAD_LONG(reg, idx)     ld      reg, (idx*SIZE_LONG)(sp)
#define PE_MACHINE      0x5064
#else
#define SIZE_LONG       4
#define SAVE_LONG(reg, idx)     sw      reg, (idx*SIZE_LONG)(sp)
#define LOAD_LONG(reg, idx)     lw      reg, (idx*SIZE_LONG)(sp)

#define PE_MACHINE 0x5032
#endif

But for 32bit and 64bit we cannot use the same values of characteristics and we need different optional header formats.

For the ARM and the x86 architecture this has resulted in separate files crt0*.S - one for 32bit, the other for 64bit.

Shouldn't we go the same way for RISC-V?

arch/riscv/lib/crt0_riscv_efi.S coff_header: · line 50

Quoted 11 lines
arch/riscv/lib/crt0_riscv_efi.S +5 -5
 	.short	section_table - optional_header	/* SizeOfOptionalHeader */
-	/*
-	 * Characteristics: IMAGE_FILE_DEBUG_STRIPPED |
-	 * IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LINE_NUMS_STRIPPED
-	 */
-	.short	0x206
+	/* Characteristics */
+	.short	(IMAGE_FILE_EXECUTABLE_IMAGE | \
+		 IMAGE_FILE_LINE_NUMS_STRIPPED | \
+		 IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+		 IMAGE_FILE_DEBUG_STRIPPED)

These values suit 64bit only.

As currently we only have a defconfig for a 64bit system - ax25-ae350_defconfig - let's merge this patch.

@Bin:
Your "riscv: Add QEMU virt board support" patch series adds a 32bit board. Please, consider adding a separate 32bit crt0*.S there.

Quoted 4 lines
arch/riscv/lib/crt0_riscv_efi.S +0 -0
 optional_header:
 	.short	0x20b				/* PE32+ format */
 	.byte	0x02				/* MajorLinkerVersion */
author
#15 lore raw

PATCH v2 6/6 riscv: efi: Generate Microsoft PE format compliant images

Hi Heinrich,

Quoted 49 lines · Heinrich Schuchardt
Quoted 26 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on RISC-V and these two members are not zero.

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

---

Changes in v2:
- use macros in pe.h for the characteristics field

 arch/riscv/lib/crt0_riscv_efi.S | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/riscv/lib/crt0_riscv_efi.S +0 -0
index 18f61f5..b7b5329 100644

arch/riscv/lib/crt0_riscv_efi.S coff_header: · line 44

Quoted 5 lines
arch/riscv/lib/crt0_riscv_efi.S +1 -1
@@ -41,13 +41,13 @@ coff_header:
      .short  2                               /* nr_sections */
      .long   0                               /* TimeDateStamp */
      .long   0                               /* PointerToSymbolTable */
-     .long   1                               /* NumberOfSymbols */
+     .long   0                               /* NumberOfSymbols */

Looking at the top of the file it is meant both for 32bit and for 64bit systems:

#if __riscv_xlen == 64
#define SIZE_LONG 8

#define SAVE_LONG(reg, idx)     sd      reg, (idx*SIZE_LONG)(sp)
#define LOAD_LONG(reg, idx)     ld      reg, (idx*SIZE_LONG)(sp)
#define PE_MACHINE      0x5064
#else
#define SIZE_LONG       4
#define SAVE_LONG(reg, idx)     sw      reg, (idx*SIZE_LONG)(sp)
#define LOAD_LONG(reg, idx)     lw      reg, (idx*SIZE_LONG)(sp)

#define PE_MACHINE 0x5032
#endif

Quoted 8 lines

But for 32bit and 64bit we cannot use the same values of characteristics and we need different optional header formats.

For the ARM and the x86 architecture this has resulted in separate files crt0*.S - one for 32bit, the other for 64bit.

Shouldn't we go the same way for RISC-V?

You observation is correct. We should use separate files to support 32-bit and 64-bit.

Quoted 12 lines

arch/riscv/lib/crt0_riscv_efi.S coff_header: · line 50

Quoted 11 lines
arch/riscv/lib/crt0_riscv_efi.S +5 -5
      .short  section_table - optional_header /* SizeOfOptionalHeader */
-     /*
-      * Characteristics: IMAGE_FILE_DEBUG_STRIPPED |
-      * IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LINE_NUMS_STRIPPED
-      */
-     .short  0x206
+     /* Characteristics */
+     .short  (IMAGE_FILE_EXECUTABLE_IMAGE | \
+              IMAGE_FILE_LINE_NUMS_STRIPPED | \
+              IMAGE_FILE_LOCAL_SYMS_STRIPPED | \
+              IMAGE_FILE_DEBUG_STRIPPED)
Quoted 9 lines

These values suit 64bit only.

As currently we only have a defconfig for a 64bit system - ax25-ae350_defconfig - let's merge this patch.

@Bin:
Your "riscv: Add QEMU virt board support" patch series adds a 32bit board. Please, consider adding a separate 32bit crt0*.S there.

Sure, will do it in coming patches.

Quoted 6 lines
Quoted 4 lines
arch/riscv/lib/crt0_riscv_efi.S +0 -0
 optional_header:
      .short  0x20b                           /* PE32+ format */
      .byte   0x02                            /* MajorLinkerVersion */

Regards,
Bin

#16 lore raw

PATCH v2 6/6 riscv: efi: Generate Microsoft PE format compliant images

In reply to Bin Meng
Quoted 5 lines

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently the COFF file header is hardcoded on RISC-V and these two members are not zero.

Quoted 8 lines

This updates the hardcoded structure to clear these two members, as well as setting the flag IMAGE_FILE_LOCAL_SYMS_STRIPPED so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Thanks, applied to efi-next

Alex

#17 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

In reply to Bin Meng
Quoted 5 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

Quoted 8 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

I couldn't find a cover letter for this series, so I'll just reply here for the whole set:

Which tree do you want to have this applied through?

Alex

author
#18 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

Hi Alex,

Quoted 14 lines · Alexander Graf
Quoted 10 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Quoted 9 lines
Quoted 3 lines

I couldn't find a cover letter for this series, so I'll just reply here for the whole set:

Which tree do you want to have this applied through?

There is no cover letter for this series. In patchwork, this series is assigned to you so I assume this should go through the efi tree.

Regards,
Bin

#19 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

Quoted 21 lines · Bin Meng

Hi Alex,

Quoted 18 lines · Alexander Graf
Quoted 13 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Quoted 8 lines
Quoted 5 lines

I couldn't find a cover letter for this series, so I'll just reply here for the whole set:

Which tree do you want to have this applied through?

There is no cover letter for this series. In patchwork, this series is assigned to you so I assume this should go through the efi tree.

Ok, in that case, are you intending to send a follow-up patch for riscv32 or do you want to do a v3?

Alex

author
#20 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

Hi Alex,

Quoted 28 lines · Alexander Graf
Quoted 24 lines · Bin Meng

Hi Alex,

Quoted 21 lines · Alexander Graf
Quoted 5 lines · Bin Meng

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

Quoted 8 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

I couldn't find a cover letter for this series, so I'll just reply here for the whole set:

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

Which tree do you want to have this applied through?

There is no cover letter for this series. In patchwork, this series is assigned to you so I assume this should go through the efi tree.

Ok, in that case, are you intending to send a follow-up patch for riscv32 or do you want to do a v3?

No, the riscv32 is totally unrelated. It can be a separate patch (series).

Regards,
Bin

#21 lore raw

PATCH v2 1/6 efi_loader: Generate Microsoft PE format compliant images

In reply to Bin Meng
Quoted 5 lines

Per Microsoft PE Format documentation [1], PointerToSymbolTable and NumberOfSymbols should be zero for an image in the COFF file header. Currently U-Boot is generating *.efi images (eg: helloworld.efi) in which these two members are not zero.

Quoted 8 lines

This updates the build rules to tell linker to remove the symbol table completely so that we can generate compliant *.efi images.

[1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format

Thanks, applied to efi-next

Alex