qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL v2 17/17] User mode support for Linux ELF files with


From: riku . voipio
Subject: [Qemu-devel] [PULL v2 17/17] User mode support for Linux ELF files with no section header
Date: Tue, 17 Jun 2014 17:57:00 +0300

From: Craig Heffner <address@hidden>

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 <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
 linux-user/elfload.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index c123244..1248eda 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1292,7 +1292,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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]