From patchwork Mon Jun 9 12:46:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31564 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB05020675 for ; Mon, 9 Jun 2014 13:23:47 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id m1sf36073394oag.6 for ; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=hL1iZ1o5JoGgU4P/LIDNzEUR/nQ+cslYjTmVJ+6yQiM=; b=L6rVa9xmCOJLyA9MHqk17vlVdpFgJtoY1orCTcaa17MLYD5+6TwSrypx3uEzmcXgCM mepjiLH7jVA86LSjq7Vv0jGN1SbZmv2nfGZCGNGnJvWPl46jeON6imh4FK8IYxHrDHGl ouNHaqFxENeYKwbCIkQMEcw8bVEQGFPzlqffwsavU8c+BacSgnsMLWT0akC28I9AEylr tGtOq0SPXUsoZxhr3qZQpEPH9aVU7Q0n8UQhK7lavEkizpuWZCrWsWgl9k5Up9v2ikNH E0fkbiTk6LjAypAL4DtMHzo9rR0Q4Q47hLjmGGsnmc0Pbu1hX07cLP9Un6QSgaHwv3HA BbPw== X-Gm-Message-State: ALoCoQkpWDsTf3vJx37pQjqT1jfcIae1s20H5/Gvdz4i6NkK5RfiEzPF6rk/aqFhHKQh0+guRbgf X-Received: by 10.182.191.73 with SMTP id gw9mr3248688obc.50.1402320227525; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.40 with SMTP id m37ls1659575qgd.18.gmail; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) X-Received: by 10.52.110.105 with SMTP id hz9mr22106293vdb.9.1402320227314; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id gr1si11831679vdc.92.2014.06.09.06.23.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 06:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id oy12so6385669veb.24 for ; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr5778842vec.9.1402320227251; Mon, 09 Jun 2014 06:23:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp145720vcb; Mon, 9 Jun 2014 06:23:46 -0700 (PDT) X-Received: by 10.140.107.67 with SMTP id g61mr4115192qgf.100.1402320226612; Mon, 09 Jun 2014 06:23:46 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j88si23044130qga.36.2014.06.09.06.23.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 06:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtz26-0002ds-B7 for patch@linaro.org; Mon, 09 Jun 2014 08:50:38 -0400 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 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 65B14265A9; Mon, 9 Jun 2014 14:46:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 9 Jun 2014 15:46:43 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org, Craig Heffner Subject: [Qemu-devel] [PULL 18/18] User mode support for Linux ELF files with no section header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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)); }