From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WifwX-0007G4-Ke for qemu-devel@nongnu.org; Fri, 09 May 2014 04:14:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WifwT-0008Fm-RT for qemu-devel@nongnu.org; Fri, 09 May 2014 04:14:09 -0400 Received: from afflict.kos.to ([92.243.29.197]:51878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WifwT-0008FR-KJ for qemu-devel@nongnu.org; Fri, 09 May 2014 04:14:05 -0400 Date: Fri, 9 May 2014 11:14:02 +0300 From: Riku Voipio Message-ID: <20140509081402.GA1115@afflict.kos.to> References: <20140507130845.21362.34400.malonedeb@chaenomeles.canonical.com> <20140507143439.20651.96263.launchpad@gac.canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Bug 1317090] Re: qemu fails on ELF files with no section headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Craig Cc: Peter Maydell , QEMU Developers , Bug 1317090 <1317090@bugs.launchpad.net> Hi Craig, On Wed, May 07, 2014 at 03:53:38PM +0100, Peter Maydell wrote: > On 7 May 2014 15:48, Peter Maydell wrote: > > 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. > > Original 2011 patch: > http://lists.gnu.org/archive/html/qemu-trivial/2011-12/msg00025.html > (hitting the 'reply' button gets us back the original email > address to fix up the signed-off-by line with, so we can > credit the fix to Craig properly.) Can you resend the patch with your Signed-Off-By: ? Riku