From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyU-0005cZ-R2 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtyyN-0007iV-Mh for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:54 -0400 Received: from afflict.kos.to ([92.243.29.197]:40170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyN-0007ha-Fw for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:47 -0400 From: riku.voipio@linaro.org Date: Mon, 9 Jun 2014 15:46:43 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PULL 18/18] User mode support for Linux ELF files with no section header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Craig Heffner From: Craig Heffner In user mode Linux, Qemu currently refuses to load ELF files that do not contain section headers (ehdr->e_shentsize == 0). Since section headers are not required in order to load an ELF file, simply removing the e_shentsize check in elf_check_ehdr() allows ELF binaries with no section headers to be run properly in user mode: Signed-off-by: Craig Heffner Signed-off-by: Riku Voipio --- linux-user/elfload.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 03a8719..b405b7f 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1272,7 +1272,6 @@ static bool elf_check_ehdr(struct elfhdr *ehdr) 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)); } -- 2.0.0.rc2