From: Peter Maydell <peter.maydell@linaro.org>
To: Bug 1317090 <1317090@bugs.launchpad.net>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Bug 1317090] Re: qemu fails on ELF files with no section headers
Date: Wed, 7 May 2014 15:48:42 +0100 [thread overview]
Message-ID: <CAFEAcA_Pft1dW5nXpaU6QLPVQX5BPQ+dL9ZzG6MVqEGLzTaeFQ@mail.gmail.com> (raw)
In-Reply-To: <20140507143439.20651.96263.launchpad@gac.canonical.com>
On 7 May 2014 15:34, Paul Jimenez <1317090@bugs.launchpad.net> wrote:
> Bug description:
> Using the latest version of qemu-user-static from trusty, 2.0.0+dfsg-
> 2ubuntu1.
>
> Reported to qemu and patch submitted long ago by the guy who wrote http://www.devttys0.com/2011/12/qemu-vs-sstrip/
> but apparently dropped on the floor - at least, I can't find it in any qemu bug tracker anywhere. It's now keeping me from running openwrt binaries under qemu-arm-static (because the openwrt guys strip section headers to save space on their teeny embedded boxes). It's a one-line patch, reproduced here:
>
> --- qemu/linux-user/elfload.c 2011-12-02 15:16:07.637541215 -0500
> +++ qemu-patched/linux-user/elfload.c 2011-12-02 15:27:24.061522798 -0500
> @@ -1068,7 +1068,6 @@ static bool elf_check_ehdr(struct elfhdr
> return (elf_check_arch(ehdr->e_machine)
> && ehdr->e_ehsize == sizeof(struct elfhdr)
> && ehdr->e_phentsize == sizeof(struct elf_phdr)
> - && ehdr->e_shentsize == sizeof(struct elf_shdr)
> && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN));
> }
Yeah; the equivalent kernel code:
http://lxr.linux.no/#linux+v3.14.3/fs/binfmt_elf.c#L595
doesn't check the section header size, and nor should QEMU.
thanks
-- PMM
next prev parent reply other threads:[~2014-05-07 14:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140507130845.21362.34400.malonedeb@chaenomeles.canonical.com>
2014-05-07 14:34 ` [Qemu-devel] [Bug 1317090] Re: qemu fails on ELF files with no section headers Paul Jimenez
2014-05-07 14:48 ` Peter Maydell [this message]
2014-05-07 14:53 ` Peter Maydell
2014-05-09 8:14 ` Riku Voipio
2014-05-09 8:20 ` Peter Maydell
2014-05-09 8:57 ` Riku Voipio
2014-08-09 4:44 ` Serge Hallyn
2014-08-09 5:29 ` Michael Tokarev
2014-08-11 16:01 ` Serge Hallyn
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=CAFEAcA_Pft1dW5nXpaU6QLPVQX5BPQ+dL9ZzG6MVqEGLzTaeFQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=1317090@bugs.launchpad.net \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).