All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] efi_loader: Generate Microsoft PE format complaint images
Date: Wed, 26 Sep 2018 20:40:38 +0200	[thread overview]
Message-ID: <65223a0b-b6b1-8a68-d920-c8af0f1c8714@gmx.de> (raw)
In-Reply-To: <1537941789-9213-1-git-send-email-bmeng.cn@gmail.com>

On 09/26/2018 08:03 AM, Bin Meng wrote:
> 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
> 
> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---


With the -s switch
- PointerToSymbolTable is 0,
- NumberOfSymbols is 0.

$ objdump -T  lib/efi_loader/helloworld.efi

lib/efi_loader/helloworld.efi:     file format pei-i386

objdump: lib/efi_loader/helloworld.efi: not a dynamic object
DYNAMIC SYMBOL TABLE:
no symbols

So the binaries are now conforming the PE standard.

qemu-x86_defconfig lib/efi_loader/helloworld.efi still contains these
sections:

Section[3] .dynamic
Section[5] .dynsym

Is this what you expect when you have 0 symbols? Should these sections
be removed with strip -R? But anyway these empty tables do no harm.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> 
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index f8c3fff..91f0b20 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -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)
>  
>               

  parent reply	other threads:[~2018-09-26 18:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  6:03 [U-Boot] [PATCH 1/5] efi_loader: Generate Microsoft PE format complaint images Bin Meng
2018-09-26  6:03 ` [U-Boot] [PATCH 2/5] x86: efi: payload: Generate Microsoft PE format complaint image Bin Meng
2018-09-26  6:03 ` [U-Boot] [PATCH 3/5] x86: efi: app: " Bin Meng
2018-09-26  6:03 ` [U-Boot] [PATCH 4/5] arm: efi: Generate Microsoft PE format complaint images Bin Meng
2018-09-26 17:51   ` Heinrich Schuchardt
2018-10-02 14:16     ` Bin Meng
2018-10-02 18:13       ` Heinrich Schuchardt
2018-09-26  6:03 ` [U-Boot] [PATCH 5/5] riscv: " Bin Meng
2018-09-26 17:49   ` Heinrich Schuchardt
2018-09-26 18:40 ` Heinrich Schuchardt [this message]
2018-10-02 14:31   ` [U-Boot] [PATCH 1/5] efi_loader: " Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65223a0b-b6b1-8a68-d920-c8af0f1c8714@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.