Skip to content

Commit

Permalink
User mode support for Linux ELF files with no section header
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
  • Loading branch information
Craig Heffner authored and Riku Voipio committed Jun 17, 2014
1 parent 480eda2 commit d3606f0
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit d3606f0

Please sign in to comment.