summaryrefslogtreecommitdiffstats
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorCraig Heffner2011-12-05 20:14:27 +0100
committerRiku Voipio2014-06-17 08:21:41 +0200
commitd3606f07440ee2c2bebea2b9932938e08b66d90b (patch)
tree13bf115c8f4aa1a5a0612ba6d106aebd4f95b579 /linux-user/elfload.c
parentlinux-user: Return correct errno for unsupported netlink socket (diff)
downloadqemu-d3606f07440ee2c2bebea2b9932938e08b66d90b.tar.gz
qemu-d3606f07440ee2c2bebea2b9932938e08b66d90b.tar.xz
qemu-d3606f07440ee2c2bebea2b9932938e08b66d90b.zip
User mode support for Linux ELF files with no section header
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 <cheffner@tacnetsol.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index c123244ecd..1248eda272 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));
}