All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] efi_loader: Generate Microsoft PE format complaint images
Date: Tue, 2 Oct 2018 22:31:17 +0800	[thread overview]
Message-ID: <CAEUhbmUK-7wEZDFst8W9+9fJAQtphxF8JCT_HQ2K8F7OVf=b2A@mail.gmail.com> (raw)
In-Reply-To: <65223a0b-b6b1-8a68-d920-c8af0f1c8714@gmx.de>

Hi Heinrich,

On Thu, Sep 27, 2018 at 2:40 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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.
>

As you said, they do no harm so let's leave them there. I indeed
investigated 'strip' before but I used the '-s' switch of the linker
in the end.

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

Regards,
Bin

      reply	other threads:[~2018-10-02 14:31 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 ` [U-Boot] [PATCH 1/5] efi_loader: " Heinrich Schuchardt
2018-10-02 14:31   ` Bin Meng [this message]

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='CAEUhbmUK-7wEZDFst8W9+9fJAQtphxF8JCT_HQ2K8F7OVf=b2A@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --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.